You are not logged in.

#1 2008-01-14 23:08:59

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Need help setting up Mysql

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

#2 2008-01-14 23:12:39

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Need help setting up Mysql

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

#3 2008-01-15 06:00:41

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Need help setting up Mysql

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

#4 2008-01-15 09:42:47

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Need help setting up Mysql

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

#5 2008-01-15 15:46:33

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Need help setting up Mysql

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 tongue

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

#6 2008-01-15 16:44:41

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Need help setting up Mysql

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

#7 2008-01-16 01:39:46

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Need help setting up Mysql

try:

set password for 'root'@'localhost' = PASSWORD('XXXXX');

Offline

#8 2008-01-16 02:00:22

Gustavo
Member
From: Brazil
Registered: 2006-07-04
Posts: 92

Re: Need help setting up Mysql

What is in your /etc/hosts?

Offline

#9 2008-01-16 07:55:00

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Need help setting up Mysql

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

#10 2008-01-23 19:34:24

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Need help setting up Mysql

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

#11 2008-01-24 17:58:32

skate_metaly
Member
Registered: 2008-01-20
Posts: 4

Re: Need help setting up Mysql

i have  the exact problem... i`m not sure what to do in this moment ...
any more ideas?

Offline

#12 2008-02-05 18:59:47

ozone baby
Member
Registered: 2008-02-05
Posts: 3

Re: Need help setting up Mysql

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 sad

Offline

#13 2008-02-22 08:43:08

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Need help setting up Mysql

Nerdman wrote:

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] Aborting

080222  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

#14 2008-02-22 18:22:26

briest
Member
From: Katowice, PL
Registered: 2006-05-04
Posts: 468

Re: Need help setting up Mysql

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

#15 2008-03-01 00:28:38

syazhani
Member
Registered: 2007-09-05
Posts: 16

Re: Need help setting up Mysql

Nerdman wrote:

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. tongue

Offline

Board footer

Powered by FluxBB