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