Mysql set up and ugrade (#1045 Cannot log in to the MySQL server

Project:Linux software
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Related pages:#49: mysql
Description

I had to reinstall the whole O.S. (Kubuntu 11.04).

I now need to reconfigure mysql.

I installed phpmyadmin but I cannot login:

#1045 Cannot log in to the MySQL server.

Comments

#1

First, properly configure the mysql root login, make sure I can login from the command line.

#2

My root password set when I installed the mysql package works:

# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.1.54-1ubuntu4 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit;
Bye

#3

Login in as root in phpmyadmin works.
Now, I need to import the old system databases and migrate them from mysql 5.0 to mysql 5.1.

#4

Title:#1045 Cannot log in to the MySQL server» Mysql set up and ugrade (#1045 Cannot log in to the MySQL server

I think the data already was at 5.1.

Now,I had problems changing the datadir.

/etc/init.d/mysql stop
cp -rp /var/lib/mysql /new/mysql/dir
vi /etc/apparmor.d/usr.sbin.mysqld

Add the following two lines to the bottom:
/new/mysql/dir r,
/new/mysql/dir/** rwk,

/etc/init.d/apparmor restart
vi /etc/mysql/my.cnf

Change datadir from:
datadir=/var/lib/mysql
to:
datadir=/new/mysql/dir

/etc/init.d/mysql restart

#5

make sure all the files in the datadir directory are owned my the mysql user.

#6

Status:active» fixed

#7

Status:fixed» closed
Related pages:-49: mysql

Automatically closed -- issue fixed for 2 weeks with no activity.