MySql Installation: Problems Past Installation

Posted by Joys of Programming on in PHP

After installing MySql from Sources, the next step is to create a user. A user “root” will be created and there is a default password associated with it. I was not aware of the default password. So I faced some problems when starting mysql. Let’s see some of the problems while working with mysql.

Let’s start using mysql.


$ ./mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

This error occurs because the mysql is not yet started.. So the next step is to start mysql daemon


$mysqld_safe

/mysqld_safe
100108 19:37:49 mysqld_safe Logging to '/usr/local/mysql/data/*.err'.
touch: /usr/local/mysql/data/*.err: Permission denied
chown: /usr/local/mysql/data/*.err: Permission denied
100108 19:37:50 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
./mysqld_safe: line 100: /usr/local/mysql/data/*.err: Permission denied
rm: /tmp/mysql.sock: Permission denied
rm: /usr/local/mysql/data/*.pid: Permission denied
./mysqld_safe: line 137: /usr/local/mysql/data/*.err: Permission denied
100108 19:37:50 mysqld_safe mysqld from pid file /usr/local/mysql/data/*.pid ended
./mysqld_safe: line 100: /usr/local/mysql/data/*.err: Permission denied

The above errors occurred because you need to be super user to start the mysql daemon


$ sudo mysqld_safe &

Now let’s start working with mysql. But do you know the password?


$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I faced this error while running for the first time. So we need to have a password (unless ofcourse if you know the default password)

Specify the password


$ sudo mysqladmin password "newpassword"

Now let’s start working with mysql


$ mysql -u root -p

Enter password:

Enter the password and you will see the mysql shell


mysql>


Tags: , , ,

Comments:

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.