Mac OS X – starting mysql server [ service ]

[root@localhost root]# mysql
ERROR 2002: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
[root@localhost root]# mysql -h 127.0.0.1
ERROR 2003: Can’t connect to MySQL server on ‘127.0.0.1’ (111)
[root@localhost bin]# mysqld
Fatal error: Please read “Security” section of the manual to find out how to run mysqld as root!
051215 11:19:00 Aborting
051215 11:19:00 mysqld: Shutdown Complete
maybe i shouldnt start mysql as root , then i start mysql as user= mysql as follow:
chown mysql.mysql -R /var/lib/mysql
mysqld –user=mysql &
051220 11:09:16 InnoDB: Started
051220 11:09:16 Fatal error: Can’t open privilege tables: File ‘/usr/share/mysql/charsets/?.conf’ not found (Errcode: 2)
051220 11:09:16 Aborting
Normal errors:
051220 11:09:16 InnoDB: Starting shutdown…
051220 11:09:18 InnoDB: Shutdown completed
051220 11:09:18 mysqld: Shutdown Complete
SOLUTION:
/usr/local/mysql$ sudo ./bin/mysqld –user=root

Leave a Reply

Your email address will not be published. Required fields are marked *