423,484 Members | 2,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,484 IT Pros & Developers. It's quick & easy.

MySQL setup, Another twist - To mysqldump restoration ?

P: n/a

I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting
site. They have done some default installations, presumably from the CVS
ports package ??. Herein lies the problem, "I do not know" what they
have done!

At first it was apparent that MySQL was installed
mysql_install_db ; GRANT TABLES etc. ???

so I ran "mysql_install_db --force"

Interestingly a 'my.cnf' file was not found on system so I installed one
from a prior installation to /etc/my.cnf

Now, server seems to launch on reboot

From ps waux: ==>
root 317 0.0 0.1 648 468 con- I 4:35AM 0:00.01
/bin/sh /usr/local/bin/mysqld_safe --user=mysql --datadir=/var/db/
mysql 444 0.0 4.0 51984 20612 ?? S 4:35AM 0:07.57
/usr/local/libexec/mysqld --basedir=/usr/local --datadir=/var/db/m
<== Server seems to be running
Attempting to enter DB ==>

mysql -h localhost -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

mach-1# mysql -h localhost -u root -p********
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

mach-1#
mach-1#

mach-1# mysql -h localhost -u mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 32 to server version: 4.0.16

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| test |
+----------+
1 row in set (0.00 sec)

mysql> USE test
Database changed
mysql> SHOW TABLES;
ERROR 12: Can't read dir of './test/' (Errcode: 13)
mysql>
mysql> CREATE DATABASE IF NOT EXISTS nu_tests;
ERROR 1044: Access denied for user: '@localhost' to database 'nu_tests'
<==

So I can't get in as user root, and the privileged user mysql is
impotent to do anything

==>
perror 1044 13
Error code 1044: Unknown error: 1044
Error code 13: Permission denied

ls -l /var/db/mysql/test
total 4
drwx------ 2 root mysql 512 Jul 4 02:27 ./
drwx------ 5 mysql mysql 512 Jul 4 14:33 ../
<==
MT test directory ...? is this supposed to be this way initially and
isn't test supposed to be accessible by all users
<==

OK so let me assume mysql is the privileged user
then

==>
GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY abcdefgh GRANT OPTION;
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'abcdefgh WITH GRANT OPTION' at line 2
mysql>
mysql> GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY 'abcdefgh' WITH GRANT OPTION;
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)
mysql>

perror 1064 1045
Error code 1064: Unknown error: 1064
Error code 1045: Unknown error: 1045
<==
Please advise!

Thanks
-- Adam --

Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
roy
try 127.0.0.1 instead of localhost and see what happens?
"Adam Smith" <ad*******@econ.com> wrote in message
news:AP********************@speakeasy.net...

I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting
site. They have done some default installations, presumably from the CVS
ports package ??. Herein lies the problem, "I do not know" what they
have done!

At first it was apparent that MySQL was installed
mysql_install_db ; GRANT TABLES etc. ???

so I ran "mysql_install_db --force"

Interestingly a 'my.cnf' file was not found on system so I installed one
from a prior installation to /etc/my.cnf

Now, server seems to launch on reboot

From ps waux: ==>
root 317 0.0 0.1 648 468 con- I 4:35AM 0:00.01
/bin/sh /usr/local/bin/mysqld_safe --user=mysql --datadir=/var/db/
mysql 444 0.0 4.0 51984 20612 ?? S 4:35AM 0:07.57
/usr/local/libexec/mysqld --basedir=/usr/local --datadir=/var/db/m
<== Server seems to be running
Attempting to enter DB ==>

mysql -h localhost -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

mach-1# mysql -h localhost -u root -p********
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

mach-1#
mach-1#

mach-1# mysql -h localhost -u mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 32 to server version: 4.0.16

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| test |
+----------+
1 row in set (0.00 sec)

mysql> USE test
Database changed
mysql> SHOW TABLES;
ERROR 12: Can't read dir of './test/' (Errcode: 13)
mysql>
mysql> CREATE DATABASE IF NOT EXISTS nu_tests;
ERROR 1044: Access denied for user: '@localhost' to database 'nu_tests'
<==

So I can't get in as user root, and the privileged user mysql is
impotent to do anything

==>
perror 1044 13
Error code 1044: Unknown error: 1044
Error code 13: Permission denied

ls -l /var/db/mysql/test
total 4
drwx------ 2 root mysql 512 Jul 4 02:27 ./
drwx------ 5 mysql mysql 512 Jul 4 14:33 ../
<==
MT test directory ...? is this supposed to be this way initially and
isn't test supposed to be accessible by all users
<==

OK so let me assume mysql is the privileged user
then

==>
GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY abcdefgh GRANT OPTION;
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'abcdefgh WITH GRANT OPTION' at line 2
mysql>
mysql> GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY 'abcdefgh' WITH GRANT OPTION;
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)
mysql>

perror 1064 1045
Error code 1064: Unknown error: 1064
Error code 1045: Unknown error: 1045
<==
Please advise!

Thanks
-- Adam --

Jul 20 '05 #2

P: n/a
Adam Smith wrote:
ls -l /var/db/mysql/test
total 4
drwx------ 2 root mysql 512 Jul 4 02:27 ./


My test directory is mode 750, user mysql, group mysql.
In any case, the uid that the mysqld process runs under should have full
access to the database directories, shouldn't it?

Also, review the procedure for post-installation of MySQL on UNIX:
http://dev.mysql.com/doc/mysql/en/mysql_install_db.html

Regards,
Bill K.
Jul 20 '05 #3

P: n/a
i must admit my knowledge with console commands is not good, as i use
the windows version which gets a gui to do these things (very lame sorry
:).

Noticed that although you tried to login as mysql, it still thinks
you're not logged in (or logged in as a blank user). How about
replacing all the tables in the "mysql" database, so at least you could
login as root again. Or better still, remove the default installation
altogether.

Adam Smith wrote:

I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting
site. They have done some default installations, presumably from the CVS
ports package ??. Herein lies the problem, "I do not know" what they
have done!

At first it was apparent that MySQL was installed
mysql_install_db ; GRANT TABLES etc. ???

so I ran "mysql_install_db --force"

Interestingly a 'my.cnf' file was not found on system so I installed one
from a prior installation to /etc/my.cnf

Now, server seems to launch on reboot

From ps waux: ==>
root 317 0.0 0.1 648 468 con- I 4:35AM 0:00.01
/bin/sh /usr/local/bin/mysqld_safe --user=mysql --datadir=/var/db/
mysql 444 0.0 4.0 51984 20612 ?? S 4:35AM 0:07.57
/usr/local/libexec/mysqld --basedir=/usr/local --datadir=/var/db/m
<== Server seems to be running
Attempting to enter DB ==>

mysql -h localhost -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

mach-1# mysql -h localhost -u root -p********
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

mach-1#
mach-1#

mach-1# mysql -h localhost -u mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 32 to server version: 4.0.16

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| test |
+----------+
1 row in set (0.00 sec)

mysql> USE test
Database changed
mysql> SHOW TABLES;
ERROR 12: Can't read dir of './test/' (Errcode: 13)
mysql>
mysql> CREATE DATABASE IF NOT EXISTS nu_tests;
ERROR 1044: Access denied for user: '@localhost' to database 'nu_tests'
<==

So I can't get in as user root, and the privileged user mysql is
impotent to do anything

==>
perror 1044 13
Error code 1044: Unknown error: 1044
Error code 13: Permission denied

ls -l /var/db/mysql/test
total 4
drwx------ 2 root mysql 512 Jul 4 02:27 ./
drwx------ 5 mysql mysql 512 Jul 4 14:33 ../
<==
MT test directory ...? is this supposed to be this way initially and
isn't test supposed to be accessible by all users
<==

OK so let me assume mysql is the privileged user
then

==>
GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY abcdefgh GRANT OPTION;
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'abcdefgh WITH GRANT OPTION' at line 2
mysql>
mysql> GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY 'abcdefgh' WITH GRANT OPTION;
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)
mysql>

perror 1064 1045
Error code 1064: Unknown error: 1064
Error code 1045: Unknown error: 1045
<==
Please advise!

Thanks
-- Adam --

Jul 20 '05 #4

P: n/a
(probably a long shot) i once used a hosting company which used mysql on
linux, and was given myphpadmin as the interface to it. Any chance a
similar setup could be happening before you acquired it, and if so
whether any scripts might still be there to give more clues...

David L wrote:
i must admit my knowledge with console commands is not good, as i use
the windows version which gets a gui to do these things (very lame sorry
:).

Noticed that although you tried to login as mysql, it still thinks
you're not logged in (or logged in as a blank user). How about
replacing all the tables in the "mysql" database, so at least you could
login as root again. Or better still, remove the default installation
altogether.

Adam Smith wrote:

I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting
site. They have done some default installations, presumably from the
CVS ports package ??. Herein lies the problem, "I do not know" what
they have done!

At first it was apparent that MySQL was installed
mysql_install_db ; GRANT TABLES etc. ???

so I ran "mysql_install_db --force"

Interestingly a 'my.cnf' file was not found on system so I installed
one from a prior installation to /etc/my.cnf

Now, server seems to launch on reboot

From ps waux: ==>
root 317 0.0 0.1 648 468 con- I 4:35AM 0:00.01
/bin/sh /usr/local/bin/mysqld_safe --user=mysql --datadir=/var/db/
mysql 444 0.0 4.0 51984 20612 ?? S 4:35AM 0:07.57
/usr/local/libexec/mysqld --basedir=/usr/local --datadir=/var/db/m
<== Server seems to be running
Attempting to enter DB ==>

mysql -h localhost -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

mach-1# mysql -h localhost -u root -p********
ERROR 1045: Access denied for user: 'root@localhost' (Using password:
YES)

mach-1#
mach-1#

mach-1# mysql -h localhost -u mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 32 to server version: 4.0.16

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| test |
+----------+
1 row in set (0.00 sec)

mysql> USE test
Database changed
mysql> SHOW TABLES;
ERROR 12: Can't read dir of './test/' (Errcode: 13)
mysql>
mysql> CREATE DATABASE IF NOT EXISTS nu_tests;
ERROR 1044: Access denied for user: '@localhost' to database 'nu_tests'
<==

So I can't get in as user root, and the privileged user mysql is
impotent to do anything

==>
perror 1044 13
Error code 1044: Unknown error: 1044
Error code 13: Permission denied

ls -l /var/db/mysql/test
total 4
drwx------ 2 root mysql 512 Jul 4 02:27 ./
drwx------ 5 mysql mysql 512 Jul 4 14:33 ../
<==
MT test directory ...? is this supposed to be this way initially and
isn't test supposed to be accessible by all users
<==

OK so let me assume mysql is the privileged user
then

==>
GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY abcdefgh GRANT OPTION;
ERROR 1064: You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'abcdefgh WITH GRANT OPTION' at line 2
mysql>
mysql> GRANT ALL PRIVILEGES ON *.* TO adamson@localhost
-> IDENTIFIED BY 'abcdefgh' WITH GRANT OPTION;
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)
mysql>

perror 1064 1045
Error code 1064: Unknown error: 1064
Error code 1045: Unknown error: 1045
<==
Please advise!

Thanks
-- Adam --

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.