# Cannot set root password in mysql 5.5.9



## hirohitosan (Mar 13, 2011)

Hi there. I installed mysql server from ports when I tried to set the root password I get the following message: 
	
	



```
# mysqladmin -u root password <pasw>
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
```
How can I check if MySQL is running? How can I check if /tmp/mysql.sock exists?

Thanks.


----------



## DutchDaemon (Mar 13, 2011)

[cmd=]service mysql-server status[/cmd] or [cmd=]ps ax | grep -i mysql[/cmd]

[cmd=]ls -al /tmp/mysql.sock[/cmd]


----------



## hirohitosan (Mar 14, 2011)

Something is wrong with mysql. I tried to start 
	
	



```
# service mysql-server start
Starting mysql.
# service mysql-server status
mysql is not running.
# ps ax | grep -i mysql
56552   0  S+     0:00.00 grep -i mysql
```
 and the /tmp/mysql.sock doesn't exist.
How can I get up and running mysql?
thanks


----------



## SirDice (Mar 14, 2011)

Look in the error log of MySQL, I'm sure the reason why it failed to start is in there.


----------



## DutchDaemon (Mar 14, 2011)

Otherwise start MySQL like this:

[cmd=]sh -x /usr/local/etc/rc.d/mysql-server start[/cmd]
or for maximum verbosity:
[cmd=]sh -xv /usr/local/etc/rc.d/mysql-server start[/cmd]

Watch every line of output carefully. You should be able to see where it bombs.


----------

