MySQL help!!

I think I screwed up my Administrative username in mysql.

mysql -u root mysql
ERROR 1044 (42000): Access denied for user ‘’@‘localhost’ to database ‘mysql’

Can I just copy all the files in /var/lib/mysql >>reinstall MySQL >> copy all the old folders into the new /var/lib/mysql ( while MySql is off)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Google: mysql lost root password

The second hit is from the MySQL docs. I usually use the

  • –skip-grant-tables option:

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Good luck.

On 11/09/2010 08:36 PM, sczlittle wrote:
>
> I think I screwed up my Administrative username in mysql.
>
> mysql -u root mysql
> ERROR 1044 (42000): Access denied for user ‘’@‘localhost’ to database
> ‘mysql’
>
> Can I just copy all the files in /var/lib/mysql >>reinstall MySQL >>
> copy all the old folders into the new /var/lib/mysql ( while MySql is
> off)
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM2hVvAAoJEF+XTK08PnB5iFAP/RNo6dQ055v6vllY2FQGdXVE
2Llonn4q4R766tYRYAFwg25YADrFwo084mnpRSjnmXVFrQyg9qMmkBdT4ev89+/o
zh6ozI/683K7iCQwmsFxr0w+RYky8Jctu/PHSAfiy5FS9NHeIWjVjs4tUwPFMyCU
PO7IaD90VVb0eT716J4wFVRIfofN8jTBVErLNfarVWoi6W2DZu8rmQE28uNMDxE0
OvqMTCvHzb4UuIlHjd03G5+gXBaapzbfJvwNNLJ5f0SGrSsMlNPwflSiga9WsVeV
w83GeXKJNSO5PruvFqghRKdSsNGswHxhW72vl1+kMz/Q/ij4tJfgyMO5reE4ja/V
+oKuM1hJWf6vXz9wkEGFAOFrs/BbVuB2yR4TbRmyUE5R/RQkSI0cj+AgWaiDOrsK
UZQmAFto3xYkLFEXOEZwMqJ4I3Hrx2KodQdbEjXIw4hIwlfVZV4MxQzfDjcqmjH8
5H5kerYnlvnDwJXZlQCO75y+xyJjd1fXLTPyGV8nbFZaCTi7En95SCwvg6hOHecp
1Di+u6Ug3w/Bmkuky7LlAajFfu1QQRKfaDWSD//L4rhD1CXku3Z4S1Xc4iWldunK
rVRlK9AqwHj67q+fXR/A/871RpWIUixK2j/gd1x+/pxX9v0CKTPoCu9icVKVVxfQ
rrqH081q8jt9VWYv7q1O
=vxEM
-----END PGP SIGNATURE-----

I tried that but it appears the username root isn’t the username anymore.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Once you’re in with that option you can do whatever you want, including
recreate root, or find out which username it is;

use mysql;
select Host, User from mysql;

Good luck.

On 11/09/2010 09:36 PM, sczlittle wrote:
>
> I tried that but it appears the username root isn’t the username
> anymore.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM2jBrAAoJEF+XTK08PnB5bGQP/0CgwlO5kCo4MlGyzW1sL1qP
0CNXrEXTJnQNekglxaliuI1Mfi0PFBYimzF0oTKdfkUw/tPn/KMTBOdYrVZKuIYf
oIFjzGpA/kyIy5u9eKVGW7cd9ARFxKYJ6pg15yvCMnnZP90sjKIhgofT6D/Yi5pi
k49DTiuUkcc+QP9SfACwaUtaEP0p2LKRDHAzSlGj3KkJlnBVjHUuK7iKOG2IHFki
cK3XM4mBMOd7S98+UaNPb0Aq7iFTltggiSpY0GkjyDFYB5XSVbQDahtv0iyWclDB
miuibMyYW+l6cQRqcdgtz7lePhQJiA5SgTj0uXtbrj507cbus6mOIe/+Tt5G0d5N
I4ss/nMnfHVoEVN8iV1e0/mQfQHcpO9rNrhRdsN8e12gL36Vhjwyy1+bECSU5crd
v2p6XzBDGAmhC6s30iCJeJ0Pps/Ec77aFb+zQxjfdkWgPlaDl+FWRsCLqAxQ7c7S
u/lYz7JVZBPXSQqpH168mrCRRl8xn4n94RRPrlmk4t4zNulT6eUQF0203v6lBUvY
LrwgMv+camv/Ge9ko2dd3SB71kTupLZw7It8MmRzdapmagpo2j/0lYMdWshqLwdt
cK3NtXizfbL3gU0lwnaKuo88VMe1KE2xf27cCI4f3j80IoNYW/Y22o111MgCjLCX
o+7KHGa7SL8slyY9g1BG
=PBcC
-----END PGP SIGNATURE-----

Ok have it fixed, sort of. I now can’t connect with phpMyAdmin or Webmin. Any ideas? MySQL Adminastrator works.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What’s the error phpMyAdmin returns? Does the user it uses work via MySQL
Administrator or were you using a different user? What do your Apache
logs show when trying to use phpMyAdmin? How is phpMyAdmin configured to
authenticate (I seem to recall it had three different options a few years
ago)?

Good luck.

On 11/10/2010 06:36 AM, sczlittle wrote:
>
> Ok have it fixed, sort of. I now can’t connect with phpMyAdmin or
> Webmin. Any ideas? MySQL Adminastrator works.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM2sCPAAoJEF+XTK08PnB5mhwP/j/pB1h6LlzeZtfUvpU+DKAh
FDWyMe3vJ9lodrC5AqqnuXvC8O0St+bCdkzLgpuOWP0BRcHPJxgNiSv8EUbk5+lx
r9xllY2O9NTpiWHMlcmPDiXFCMgJR0/7g1moFU4n5UqtStl5MRnaOECvGY9r+XR5
EqeHqgqi4zP0KWw6xWnFWjsx8YDzs7z/dZSE6B6gZXvPiVeFWNXV7XgiTNJBFJwZ
61YP7uvbEQmQtdLFo6lxN9B6PvDmbk/8P2FOiF9L0NqbhLioYZ2nVtGjia8FMqMg
221hEofixmtCbMknlyLD8iCsCvPRuJFAsqURjlPoGj1rn9+GULQZfieawuYj4fbH
39XWaDWA97w4u8aDWOY3Uf2KIGup0K/FMAZ/1BXfV79THDhZkxkbvrNXUW3tEB5i
/1Ia1qdRwp06cWlZcxk0cjvtJtJGrzSUXpJVykXnCYNAutKanX5zS/eYUHhocGJa
WZMA8uUrtD8nhB5IT5sEItefyF7c4+ias/gBi5cwk4hT3QO3vPzCL48XijHVwlGZ
PhpA5cIMNVheEt9eqeLt2z+HUuzXZjXM2l/Aym2SWzm2X9KGw/lrIZXJppimtKpV
9t0RGgqjdfVUPQ35e63xUvD5Mg5pogIdzE5nRiJbBPUS7J8VzWxd0xfVDbuNsCJR
GI8XjRFI7wtInFSvisY7
=Byan
-----END PGP SIGNATURE-----

phpMyAdmin says “Wrong username/password. Access denied.” I’m using the root and password that I used for MySQL
Administrator.

Apache log for today:
[Wed Nov 10 00:14:37 2010] [notice] caught SIGTERM, shutting down
[Wed Nov 10 00:15:35 2010] [notice] Apache/2.2.15 (Linux/SUSE) mod_ssl/2.2.15 OpenSSL/1.0.0 PHP/5.3.3 configured – resuming normal operations
[Wed Nov 10 00:30:48 2010] [notice] caught SIGTERM, shutting down
[Wed Nov 10 07:46:34 2010] [notice] Apache/2.2.15 (Linux/SUSE) mod_ssl/2.2.15 OpenSSL/1.0.0 PHP/5.3.3 configured – resuming normal operations
[Wed Nov 10 09:16:06 2010] [error] [client 192.168.0.3] File does not exist: /srv/www/htdocs/phpMyAdmin/scripts
[Wed Nov 10 09:17:55 2010] [error] [client 192.168.0.3] Invalid method in request \x16\x03\x01

The phpMyAdmin authenticate? I am running the almost duplicate configuration on my laptop. I downloaded phpMyAdmin from the 1-click install on the laptop first then my server. I have been playing with Yabs on my laptop and wanted to move it to my server.

Never had these problems with Mysql, Webmin, or phpMyAdmin.

Thanks for your help…

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Login to MySQL and run the following and post the results, possibly
changing slightly the Password column’s values just for fun:

use mysql;
select Host, User, Password from user;

I’m guessing your ‘root’ user is only allowed from something like
‘localhost’ and it may be coming from something (via phpMyAdmin) like your
hostname, which according to MySQL, is different. MySQL’s right are based
on username, password, and the host from which the connection originates.
Using ‘%’ as the Host value means the login can come from anywhere and
may be an easy test to see if it improves things. Having the output from
above (with passwords obfuscated if you’d like) could confirm this.

Good luck.

On 11/10/2010 08:06 PM, sczlittle wrote:
>
> phpMyAdmin says “Wrong username/password. Access denied.” I’m using the
> root and password that I used for MySQL
> Administrator.
>
> Apache log for today:
> [Wed Nov 10 00:14:37 2010] [notice] caught SIGTERM, shutting down
> [Wed Nov 10 00:15:35 2010] [notice] Apache/2.2.15 (Linux/SUSE)
> mod_ssl/2.2.15 OpenSSL/1.0.0 PHP/5.3.3 configured – resuming normal
> operations
> [Wed Nov 10 00:30:48 2010] [notice] caught SIGTERM, shutting down
> [Wed Nov 10 07:46:34 2010] [notice] Apache/2.2.15 (Linux/SUSE)
> mod_ssl/2.2.15 OpenSSL/1.0.0 PHP/5.3.3 configured – resuming normal
> operations
> [Wed Nov 10 09:16:06 2010] [error] [client 192.168.0.3] File does not
> exist: /srv/www/htdocs/phpMyAdmin/scripts
> [Wed Nov 10 09:17:55 2010] [error] [client 192.168.0.3] Invalid method
> in request \x16\x03\x01
>
> The phpMyAdmin authenticate? I am running the almost duplicate
> configuration on my laptop. I downloaded phpMyAdmin from the 1-click
> install on the laptop first then my server. I have been playing with
> ‘Yabs’ (http://openyabs.org) on my laptop and wanted to move it to my
> server.
>
> Never had these problems with Mysql, Webmin, or phpMyAdmin.
>
> Thanks for your help…
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM22UeAAoJEF+XTK08PnB5zKMP/Am8R4beSCiJoKV2EWg3De+G
J5QebmU0nKd/fp9p6oRJ+9T/7BGPFHkdnpMw32cFbyj94mA4X0BHxeJQHU9PBF6o
g8UQavy++/7PYRhvx9+qNhm42PdgEeaVFzprOn6YN0DgQbYzJv9MkRqjPnSse4ao
0Pcr4VDTvssiaYaP3Jljr0k5saASTsD6HusCUtm2V9ZTuMLnjJKKz4gkZ0jTFIzO
YTTMk7jX5T2LvvCVf+Zfwwv8aJ8eOXmIVoZB912OMPECQM4BFHb/pDsRWg0CMVPY
+TZxaavuO47CRdWAjxQ187V315P2KjSrybp/YqaEsuUecSltP5ynKxLt3DcyPBmF
WjXzrqcrI2Gdvb/egBtnYV5LGV2IF03HZEzTOqRnDPljpGrudoTxzS76/TvhR9zy
E8eWr9KkEPIv3o3FhjMpz6BNT++MN0J6TXns8Vk840XF9pwF7RjNSkKZ3UdP+sRO
5QCrGQDMPESTAaAIUtxDPl0R/pSoshrhjzKsiZY74sjmRooZLSnRJAF9C6k65VH4
hjuwhL5dmSfSF421XPrYkrU0LX9qMaN0ZjJsrJwaPhh0pxwZO5+o4vT2K/yDES21
aKUnUH/XbHCfmN6UH313FAdUIJdElAaiI1div1gx4RxoZVPLir84LPyQsAOrHPav
n7OuJfJPk9Nj0o4MGTNy
=4TlR
-----END PGP SIGNATURE-----

I Just removed phpMyadmin and shut down the server. Before I shut down the server I manually backed up Mysql and i noticed there was a problem with using localhost and the ip number. I lost “user administration” in the GUI of MySql Administration. I will reinstall phpMyAdmin tomorrow and recheck. I did notice that had ‘%’ was set. I’ll let you know.

I then logged into mysql via mysql administrator and saw root under localhost had no assigned privileges . I assigned them and everything started to work even webmin. I did notice that now under phpMyAdmin root@localhost I was not granted ALL PRIVILEGES and when I tried I got >> 1045 - Access denied for user ‘root@localhost’ (using password yes) . I then went to webmin and gave all privileges and now phpMyAdmin sees all privileges. Very Odd but everything seems to work now.

Thanks again for your help and input.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well done. Thank-you for posting back your results.

Good luck.

On 11/11/2010 05:06 PM, sczlittle wrote:
>
> I then logged into mysql via mysql administrator and saw root under
> localhost had no assigned privileges . I assigned them and everything
> started to work even webmin. I did notice that now under phpMyAdmin
> root@localhost I was not granted ALL PRIVILEGES and when I tried I got
>>> 1045 - Access denied for user ‘root@localhost’ (using password yes)
> . I then went to webmin and gave all privileges and now phpMyAdmin sees
> all privileges. Very Odd but everything seems to work now.
>
> Thanks again for your help and input.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJM3JzdAAoJEF+XTK08PnB5ER4QAKl8xCvQUatJzj7utJ6ckxj2
mszM/f8NrR+thdEry0qbOF788TjT4HG2MVkHNVgIZ3k4MGmSk7Uoan45unYW7vAD
4xaCQ+EvMPIQvg0xQOZczqwbWKGikdxl7NrqOvvNvlDUta4bM0R8/4PjblKGf5Ou
hC1mlmCNLYZw3Osf9SLY5fifh/SExVzPs8rnVQmxfgrMyCvUYcHdCNfWL4BVeeHv
WJiQMA4ErIaTDthaO2OaMUN5EaANPlmu/1DoPo6o2if7tWPRZPIdGLK+7hK89UFt
yO8QhRil3mK6L84LFlb2GwOQ7UjUmq+GXM8/8JD+qMJWkxcNUxse0TJ4qCAbi6ZV
Zq+JLtu0atKq/n+IY/NECrFABeYpdvAr0LIK15tX65/zzlrNBHcQkVvyRW5s5PHe
5b1EZj+Q2SDu6nKEKroDAyyw06xZ7WMnmGOwUPw1OilgJ4R130OQKWRgKJB8tDYj
TFsCKYX8bqNpCiVnLGdTgaClOog7cOaUuWCdRxTFBy6wHY6xeHmexn3uhEdCbMlK
fSjpQ8ujUq9d02Htcm6UMfcNcd2oCOMJIOhTUUqp6yUJPVAWNsgyls+CY5rTb0lk
qGkE7sbdY5ibDNOvoQq2eR1BJ/CvDj3jom0PxaQWHifwG/zJqf/QtdFD2cPfZ9Pp
pJNrUsMoYScHZ5MSamso
=fcwm
-----END PGP SIGNATURE-----