LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't Log in to MySQL after setup (https://www.linuxquestions.org/questions/linux-newbie-8/cant-log-in-to-mysql-after-setup-576749/)

FWSquatch 08-13-2007 09:27 AM

Can't Log in to MySQL after setup
 
I'm running Freelink (Debian 3.1) on my Buffalo Linkstation and I'm trying to set up MySQL. I followed this walkthrough and downloaded mysql-5.0.41. I was able to get it installed and I can start up the server but I can't login to it. I've tried to log in from the command line and from Webmin with no luck. Here's what happens when I try to login:

Code:

Paragon:/mnt/opt/mysql# bin/mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Paragon:/mnt/opt/mysql#

The same thing happens when I specify the user as mysql.

lord-fu 08-13-2007 09:29 AM

Can you verify the server is running? If it is try
mysql -u root.

FWSquatch 08-13-2007 09:34 AM

Yes, it is running. At least I think this means that it is:

Code:

Paragon:/mnt/opt/mysql# /etc/init.d/mysql.server start
Starting MySQL
Paragon:/mnt/opt/mysql# bin/mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


lord-fu 08-13-2007 09:39 AM

Try:

ps aux | grep mysql

or

ps aux | grep mysqld

One of them should show a few lines with a mysql process. Did you edit my.cnf and move it into place? I am sorry I did not read the link you provided. At any point did you change or add a root password etc? On my machine I can see any error messages printed to /var/db/mysql/ .

substitute HOSTNAME with your machine name. May be a bit different for you, not too sure.

cat /var/db/mysql/HOSTNAME.err

Hope it helps some.

lord-fu 08-13-2007 09:56 AM

I just checked on a Linux machine (FC7) and it has its data directory under /var/lib/mysql but it's logs do go to /var/log/mysqld.log . So you may be able to check that for more info. Sorry about that.

Hope it helps some.


Also do a search here on LQ for your problems as there are loads of these questions about mysql processes not starting, running, connection issues etc. Some even by myself ;}

bzposse 08-13-2007 10:01 AM

Have you tried reseting the password ?
However you must start sql server first

/etc/init.d/mysql.server start

/mnt/opt/mysql/bin/mysqladmin -u root password 'new-password'
/mnt/opt/mysql/bin/mysqladmin -u root -h 'servername' password 'new-password'

FWSquatch 08-13-2007 10:02 AM

Thank you so much for the quick replies. When I do the command "ps aux | grep mysql" I get a lot of entries that look like this:

Code:

mysql      455  0.0 20.8 43672 13056 ?      S    09:49  0:00 /mnt/opt/mysql/libexec/mysqld --basedir=/mnt/opt/mysql --datadir=/mnt/opt/mysql/var --user=mysql --pid-file=/mnt/opt/mysql/var/Paragon.pid --skip-external-locking --port=3306 --socket=/tmp/mysql.sock
root      1267  0.0  0.9  1648  580 pts/0    S+  09:53  0:00 grep mysql
Paragon:/mnt/opt/mysql#

I have my.conf located in the /etc folder and it looks like this (I edited out the commented lines):

Code:

[client]
#password      = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
bind-address = 127.0.0.1


server-id      = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

I did add a user (mysql) and a password. I also added a root password. I could not find a log file in any of those places.

FWSquatch 08-13-2007 10:06 AM

Thanks for the replies, guys. I just tried what bzposse said and got this:

Code:

Paragon:/var/log# /mnt/opt/mysql/bin/mysqladmin -u root -h 'paragon' password 'new-password'
/mnt/opt/mysql/bin/mysqladmin: connect to server at 'paragon' failed
error: 'Host 'localhost' is not allowed to connect to this MySQL server'
Paragon:/var/log#

Maybe this is the problem? Is it possible that I have a setting that doesn't allow me to use MySQL from localhost?


All times are GMT -5. The time now is 04:08 PM.