You are not logged in.
Hey... altho this worked in the past, on my fresh arch install mysql wont do what i want it to.
i just did what the wiki entry tells me to do... which is install mysql and run
mysqladmin -u root password MYPASSWORD as root
i only get the following tho:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Anyone a clue what i am doing wrong?
I can swear on my last setup this thing worked...
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
try
#mysqladmin -u root -p
i believe this should drop you into a "password:" prompt where you would type in your root password for mysql. this is how the mysql cli works anyway.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
mysqladmin -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
The same syntax with mysql does nothing at all
Last edited by Rasi (2008-01-15 09:14:43)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
just to let you know what i tried by now...
i started mysql with
/usr/bin/mysqld_safe --user=root --pid-file=/var/run/mysqld.pid --skip-grant-tables &
this made it possible to connect to mysql with the command
mysql -u root mysql
inside of the mysql prompt i changed my password with
update user set password=password('NEWPASSWORD') where User='root' and host='localhost';
flush privileges;
after i restarted the daemon i still wasnt able to connect:
[root@localhost carnager]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Alright.. i removed /var/lib/mysql and all config files.
Removed Mysql with pacman -Rsc mysql.
Now i will try from scratch.
So be my guest
pacman -S mysql
Prüfe Paketintegrität...
(2/2) Pruefe auf Dateikonflikte [#####################] 100%
(1/2) Installiere mysql-clients [#####################] 100%
(2/2) Installiere mysql [#####################] 100%
fine.. that worked.
[root@localhost carnager]# /etc/rc.d/mysqld start
:: Starting MySQL [DONE]
[root@localhost carnager]#
Seems about right, doesnt it?
So lets configure our mysql root account...
[root@localhost carnager]# mysqladmin -u root password XXXXX
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
*sigh*
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Alright.. with the Help of Redshift we managed to get a connection to mysql. But thats all, i cant send any commands...
[root@localhost carnager]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.0.51 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set password for root@localhost = password('XXXXXXXX');
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'mysql'
[root@localhost carnager]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.51 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database amarok;
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'amarok'
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
try:
set password for 'root'@'localhost' = PASSWORD('XXXXX');
Offline
What is in your /etc/hosts?
Offline
127.0.0.1 localhost.localdomain localhost
To be honest.. for now i have the feeling something with the package is borked... i cleanly removed everything related with mysql and tried to install it from scratch.
I get this all the time:
[root@localhost carnager]# /etc/rc.d/mysqld start
Installing MySQL system tables...
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080116 8:53:49 [ERROR] Aborting
080116 8:53:49 [Note] /usr/sbin/mysqld: Shutdown complete
Installation of system tables failed!
Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/sbin/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.
The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!
:: Starting MySQL [DONE]
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Not sure if this is your issue, but /etc/hosts should contain your hostname at the end, like this:
127.0.0.1 localhost.localdomain localhost yourhostname
Some programs won't run properly without this. I am not sure if MySQL is one.
Offline
i have the exact problem... i`m not sure what to do in this moment ...
any more ideas?
Offline
Hi everybody) This is my first post on this forum. I have just moved to Arch, and till now I successfully used wiki to solve problems.
I have the same problem, as described in this topic, and I don't know what to do
Offline
I had before the same problem.
Some reason, the MySQL believe that two localhost exist (actually coexist).
Installing MySQL system tables... ERROR: 1062 Duplicate entry 'localhost-' for key 1
Edit /etc/rc.conf
HOSTNAME="myhost"
Edit /etc/hosts
#ip-address hostname.domain.org hostname 127.0.0.1 localhost.localdomain localhost myhost
After that:
su mysql_install_db
But I recommend to delete /var/lib/mysql and reinstall the mysql package, instead of mysql_install_db.
(Sorry for my bad english)
I did what you said.... but its not working... still the same error
[root@localhost carnager]# mysql_install_db
Installing MySQL system tables...
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080222 9:41:57 [ERROR] Aborting080222 9:41:57 [Note] /usr/sbin/mysqld: Shutdown complete
Installation of system tables failed!
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Reboot, so the system could notice changes you had made to rc.conf. Or execute
hostname myhost
before installing MySQL.
MySQL during installation tries to create entries for both root@localhost and root@$hostname probably because of special meaning the name 'localhost' has in MySQL (you may see Invoking MySQL Programs in MySQL documentation; in short, 'localhost' means connecting via unix socket, not tcp). Bizarre, IMO, but documented.
Offline
I had before the same problem.
Some reason, the MySQL believe that two localhost exist (actually coexist).
Installing MySQL system tables... ERROR: 1062 Duplicate entry 'localhost-' for key 1
Edit /etc/rc.conf
HOSTNAME="myhost"
Edit /etc/hosts
#ip-address hostname.domain.org hostname 127.0.0.1 localhost.localdomain localhost myhost
After that:
su mysql_install_db
But I recommend to delete /var/lib/mysql and reinstall the mysql package, instead of mysql_install_db.
(Sorry for my bad english)
Thanks, worked for me. Been having problem with mysql for months after I messed up by doing something I can't even recall anymore.
Offline