# MySQL Errors

## G3n2

hi ,

im getting this error:

```

mysqladmin -u root -h amd800_tux password 'PASS'

mysqladmin: connect to server at 'amd800_tux' failed

error: 'Access denied for user: 'root@localhost' (Using password: NO)'

```

any way to fix this one ?

mysqladmin -u root password 'PASS' worked Confused

Also phpadmin says :

```

 Server localhost

Error

MySQL said:

#2002 - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)

```

there is a mysqld.sock file in /var/run/mysqld/mysqld.sock

i see an empty file when i edit it with nano.

and e107 says this :

```

 e107 was unable to establish a connection to mySQL using the information you entered.

Please return to the last page and ensure the information is correct.

```

i can type mysql and make a database

```

create database 'database';

grant all privileges *********

```

im using

```

mysql  Ver 12.22 Distrib 4.0.20, for pc-linux-gnu (i386)

```

with

```

Server version: Apache/2.0.50

```

i dont know whats wrong , and i havent had this problem with debian , so can anyone help me fix mysql in Gentoo?

any help would be greatly appreciated.

thx

-G3n2

----------

## G3n2

no Mysql guru here ?

i just need to emerge mysql , get it to work with e107 and phpmyadmin , i've been trying to fix this for about 2 weeks now , and im getting pissed   :Crying or Very sad: 

anyone have a working tutorial for Mysql installing in Gentoo ? plz  :Sad: 

-G3n2

----------

## kashani

# it's best to never put your mysql password on the command line.

mysql -u root -p

# now lets see what's going on

use mysql;

select * from user where User='root';

If your root account isn't allowed to connect to your ether IP then mysql will deny it. Generally you'd have two line containing root, localhost and %. The % indicates that root can connect from any address. You can even specify 10.10.10.%, amd800.yourdomain.com,  or a number of other things. 

kashani

----------

## G3n2

sry i dont really understand since im a mysql and linux noob ^^

so could u try to explain the basic steps to me ?

i did this :

```

use mysql;

mysql> select * from user where User='root';

```

and i get this :

```

[THIS CODE THINGY WAS SERIOUSLY F*CKING UP THIS POST :oops:]

```

for my e107 database (name=e107) 

i got e107 to work by doing this :

READ https://forums.gentoo.org/viewtopic.php?t=78718

start mysql and execute the following commands:

```

mysql

  SET PASSWORD FOR root@localhost=PASSWORD('new_password');

  grant INSERT,SELECT on root.* to e107@localhost;

  SET PASSWORD FOR e107@localhost=PASSWORD(net_password);

  grant CREATE,INSERT,SELECT,DELETE,UPDATE on e107.* to root@localhost;

  grant CREATE,INSERT,SELECT,DELETE,UPDATE on e107.* to root;

  exit

```

so e107 works , i also installed phpbb2 , which also works , but just phpmyadmin keeps saying :

```

Server localhost

Error

MySQL said:

#1045 - Access denied for user: 'root@localhost' (Using password: YES)

```

i dont really know whats its exactly what it tries to connect to (phpmyadmin connects to *?  :Neutral: )

Thx for any helping efforts   :Very Happy: 

-G3n2  :Embarassed: Last edited by G3n2 on Tue Aug 24, 2004 1:49 pm; edited 1 time in total

----------

## kashani

I think pma is the phpmyadmin account. What does the following show for you? I'd suspect that the pma account might not be setup right if I'm understanding your email correctly.

use mysql;

select * from user where User='pma';

kashani

----------

## G3n2

i edited the phpmyadmin config (config_inc.php) to use root access instead of pma.

and root should be able to access it because e107 and phpbb2 can already.

-G3n2

----------

## kashani

Ah... but if you look at your output root has a password for localhost, but not from your hostname. If the requests comes from the hostname it won't need a password. I'd suggest making these both the same and see if it works. 

kashani

----------

## G3n2

ok , thx ill try that , but my gentoo box was seriously f*cked up after an emerge -u world with ~x86 =X i accidentely added ~x86 while it was updating glibc some day and i commented #ACCEPT_KEYWORDS and it gave some errors about downgrading , so i uncommented it again , updated and checked  everything , but it was already to late =p. so no more ~x86 for me.

anyway im reinstalling now , and ill be installing apache2 , mysql and php again in about 1 hour , then ill post an update if it works  :Smile: 

-G3n2

----------

## G3n2

all is back now  :Smile: 

ok so this i try'ed :

```

mysql> select * from user where User='pma';

Empty set (0.04 sec)

```

so pma user had no right whatsoever.

```

mysql> select * from user where User='root';

+------------+------+------------------+-------------+-------------+------------

-+-------------+-------------+-----------+-------------+---------------+--------

------+-----------+------------+-----------------+------------+------------+----

----------+------------+-----------------------+------------------+-------------

-+-----------------+------------------+----------+------------+-------------+---

-----------+---------------+-------------+-----------------+

| Host       | User | Password         | Select_priv | Insert_priv | Update_priv

 | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process

_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Sho

w_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv

 | Repl_slave_priv | Repl_client_priv | ssl_type | ssl_cipher | x509_issuer | x5

09_subject | max_questions | max_updates | max_connections |

+------------+------+------------------+-------------+-------------+------------

-+-------------+-------------+-----------+-------------+---------------+--------

------+-----------+------------+-----------------+------------+------------+----

----------+------------+-----------------------+------------------+-------------

-+-----------------+------------------+----------+------------+-------------+---

-----------+---------------+-------------+-----------------+

| localhost  | root | 662d88246c5b14ef | Y           | Y           | Y

 | Y           | Y           | Y         | Y           | Y             | Y

      | Y         | Y          | Y               | Y          | Y          | Y

          | Y          | Y                     | Y                | Y

 | Y               | Y                |          |            |             |

           |             0 |           0 |               0 |

| amd800_tux | root |                  | Y           | Y           | Y

 | Y           | Y           | Y         | Y           | Y             | Y

      | Y         | Y          | Y               | Y          | Y          | Y

          | Y          | Y                     | Y                | Y

 | Y               | Y                |          |            |             |

           |             0 |           0 |               0 |

| %          | root |                  | N           | N           | N

 | N           | N           | N         | N           | N             | N

      | N         | N          | N               | N          | N          | N

          | N          | N                     | N                | N

 | N               | N                |          |            |             |

           |             0 |           0 |               0 |

+------------+------+------------------+-------------+-------------+------------

-+-------------+-------------+-----------+-------------+---------------+--------

------+-----------+------------+-----------------+------------+------------+----

----------+------------+-----------------------+------------------+-------------

-+-----------------+------------------+----------+------------+-------------+---

-----------+---------------+-------------+-----------------+

3 rows in set (0.00 sec)

```

according to this table root now has privileges on localhost and amd800_tux.

and with the new install , phpmyadmin says :

```

MySQL said:

#1045 - Access denied for user: 'pma@localhost' (Using password: YES)

```

so what needs doing ? just fixing pma rights ? what rights should i give it ? all? any help is appreciated. thx

-G3n2

[PS][EDIT]

Going to try e107 and phpbb2 again  :Smile:  *They Work

[/PS][/EDIT]

----------

## kashani

You need to create the pma use if you did not already and give it the proper right. phpbb works because it probably uses a different username in Mysql.

When you ran the ebuild for phpmyadmin it should end with the commands you need to add the pma user correctly. Check the ebuild or just remerge it to see it again.

kashani

----------

## juugcatm

These are the instructions I received from my phpmyadmin setup. I was having the same problem of not having a pma account and this script added it.

```

To complete installation, you must

1. Update MySQL's grant tables and the pmadb database:

     mysql -u root -p < /usr/share/webapps/phpmyadmin/2.5.7_p1/sqlscripts/mysql/2.5.7_p1_create.sql

2. Reload MySQL:

     /etc/init.d/mysql restart

```

----------

