How to configure mysql server?
Timothy Murphy
tim at birdsnest.maths.tcd.ie
Fri Jun 23 11:34:18 UTC 2006
Henry Hartley wrote:
> Assuming, as others have suggested, that you set the root password
> accidentally, you'll want to change it to something you know. This
> isn't a big deal on a system you control. Simply follow the
> instructions here:
>
> http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
Thanks very much.
I followed the instructions, with one important difference -
I left the file mysql-init in /tmp -
and I can now connect as root!
-----------------------------------------------
[root at alfred ~]# service mysqld stop
Stopping MySQL: [ OK ]
[root at alfred ~]# cat /tmp/mysql-init
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('foo');
[root at alfred ~]# mysqld_safe --init-file=/tmp/mysql-init &
[1] 15993
WARNING: Found /var/lib/mysql/my.cnf
Datadir is deprecated place for my.cnf, please move it to /usr
[root at alfred ~]# Starting mysqld daemon with databases from /var/lib/mysql
[root at alfred ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.22
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit;
Bye
-----------------------------------------------
When I followed the instructions exactly, and ran
mysqld_safe --init-file=~/mysql-init &
or
mysqld_safe --init-file=./mysql-init &
I found the error
060623 12:05:09 InnoDB: Started; log sequence number 0 43655
060623 12:05:09 [ERROR] /usr/libexec/mysqld: File '~/mysql-init' not found
(Errcode: 2)
060623 12:05:09 [ERROR] Aborting
in /var/log/mysqld.log .
I presume that mysqld_safe is run by mysql in ~mysql ,
and so ~ and . are both taken to mean ~mysql .
--
Timothy Murphy
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
More information about the fedora-list
mailing list