LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   mysql daemon fail to start on slackware 10.2 (http://www.linuxquestions.org/questions/linux-server-73/mysql-daemon-fail-to-start-on-slackware-10-2-a-489433/)

sharathg786 10-04-2006 02:19 PM

mysql daemon fail to start on slackware 10.2
 
hi, i'm trying to run mysql on slackware 10.2, but whenever i want to start mysqld, i get the following error:

Code:

Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
061004 23:38:28  mysqld ended

i start it as root using this command:
# /etc/rc.d/rc.mysqld start

i found a similar thread which said to make sure there is an entry in the /etc/passwd file with 'mysql' as a user which is already there in my system, but still it i get the same error.

tronayne 10-04-2006 04:53 PM

Did you, as root, run
mysql_install_db --user=mysql

trickykid 10-04-2006 09:20 PM

And if you did run mysql_install_db without the user=mysql option, you need to chown the ownership of the /var/lib/mysql to the mysql user.

chown -R mysql.mysql /var/lib/mysql

sharathg786 10-05-2006 05:00 AM

thanx for your replies, but now there's another problem

the daemon is starting
# /usr/bin/mysqld_safe &

but when i run mysql as root i get the following error:

Code:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
i tried to set for mysql root user by giving this command:
# /usr/bin/mysqladmin -u root password 'new-password'

now when i gave the new passwd using this command, it shows:
Enter password:
should i enter root passwd of the system or the one i just gave?(i may sound stupid but i've never used mysql before), anyway i tried both but it showed:
Code:

error: 'Access denied for user 'root'@'localhost' (using password: YES)'
however i can run mysql under a normal user, but when i tried to create a database, it showed this:

Code:

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sharath1'
i think the problem is there is no permission for any user to run mysql server in my system, how do i change it?

tronayne 10-05-2006 08:19 AM

You need to take a look at the MySQL manual: http://dev.mysql.com/doc/refman/4.1/en/index.html, specifically http://dev.mysql.com/doc/refman/4.1/...rivileges.html and http://dev.mysql.com/doc/refman/4.1/...ing-users.html

sharathg786 10-05-2006 02:59 PM

i read those manuals you mentioned, according to that after i start mysqld_safe the next step is to set the root password, i used this command :

Code:

mysqladmin -u root password "newpwd"
but it showed me this:

Code:

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

as a normal user i can run mysql, but when creating a database it shows:

Code:

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sharath'

tronayne 10-05-2006 03:53 PM

You know, it might just be easier to start over (you won't hurt anything doing this).

Log in as root, cd /var/lib, rm -r mysql (that blows away your existing data base), mkdir mysql (although this isn't strictly necessary...).

Then run mysql_install_db --user=mysql (that recreates all the structure).

Then follow the instructions in the manual pages to the letter and you'll probably be good to go.

By the way, rather than mysqladmin get into the mysql data base with
mysql mysql
it's a little easier sometimes; also, pay close attention to spaces in commands you use (in fact, you can copy-paste many of the examples in the manual page, obviously changing the passwords to the ones you want to use).


All times are GMT -5. The time now is 03:52 PM.