Access denied? error.mysql -u root test. This
should not give an error. You can also check if you have a file 'user.ISD'
in the mysql database directory (ordinary install_dir/var/mysql/user.ISD).
mysqladmin reload each time you change
the grant tables. Otherwise the old tables are still used!
--without-grant-tables option. Now you can change the MySQL
grant tables and use the script mysqlaccess to check if your
grant worked. mysqladmin reload tells the mysqld daemon to
start using the new grant tables.
mysql -u user database or
mysql -u user -ppassword database. Please notice that there is no
space between -p and the password. One can also use the
--password=your_password syntax to give the password!
mysql -u user database then you have a problem with
the 'user' table. Check this by doing mysql -u root mysql and
select * from user. You should get an entry with 'hostname' and
'user' matching your computers hostname and your username. If the client
and the server are running on the same host and you haven't used the
--host option to mysql and you are not using MIT threads,
'localhost' is a synonym for your hostname.
Access denied error message will tell you who you are trying
to log in as, from which host you are trying to log in, and if you
were using a password or not. You should normally have one entry in the
user table that exactly matches your host and user, exactly as
given in the error message.
mysql -u root test works but mysql -h your_hostname -u
root test gives 'Access denied' then you don't have the right name for
your host in the user table. For example if you have an entry with host
'tcx' in the 'user' table, but your DNS tells MySQL that your
hostname is 'tcx.subnet.se' then the entry will not work. Test by adding
a record with the IP of your host in the 'user' table. You can,
natuarally, also add a host with a wildcard (for example 'tcx%') in the
'user table' (but using hostnames ending with % is pretty insecure).
mysql -u user database works on the server machine, but
mysql -u host -u user database doesn't work on another client
machine, then you don't have the client machine in the 'user' or the
'db' table.
mysql -u user test works but mysql -u user
other_database doesn't work, you don't have the other_database in the
'db' table.
SELECT
... INTO OUTFILE or LOAD DATA SQL commands then you probably
don't have the File_priv privilege set for you in the user table.
mysqld daemon with:
--debug=d,general,query. This will print info about the host and
user that tries to connect and also information about each command
issued. See section Debugging MySQL.
mysqldump mysql command. As always, post your problem with the
mysqlbug script.
Can't connect to local mySQL server or
Can't connect to MySQL server on some_hostname this means that
the daemon mysqld is not running or you are trying to connect to the wrong
socket or port. Check that the socket exists (normally /tmp/mysql.sock) or
try to connect to the port with telnet: telnet hostname 3306.
You can also try mysqladmin version to get some more information.
Go to the first, previous, next, last section, table of contents.