How to start/stop mysql server on Ubuntu?

13 10 2010

Its really simple, just open the terminal and give the command below to start mysql server –
sudo /etc/init.d/mysql start

To restart mysql server, use the command –
sudo /etc/init.d/mysql restart

You can stop mysql server by simply the command –
sudo /etc/init.d/mysql stop

If your mysql server isn’t running and you attempt to connect to the mysql server, you may get a warning like this –

Warning: mysql_connect() [function.mysql-connect]: [2002] No such file or directory (trying to connect via unix:///var/run/mysqld/mysqld.sock) in /home/atik/www/***.php on line ***

In that case, just start the mysql server.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: