LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-10-2007, 10:14 AM   #1
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Rep: Reputation: 17
User problems - mysql


Ok so I've installed the mysqld package for slackware. I've secured all the default passwords, and added a user. Problem is this:

Code:
nathacof@confucious:~$ mysql -u nathacof -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 33 to server version: 5.0.24a

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

mysql> show grants;
+---------------------------------------------------------------------------------------------------------+
| Grants for @localhost                                                                                   |
+---------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' IDENTIFIED BY PASSWORD '*3F362EA315B674EE4C93FA7AF2F5C4F3F6067405' |
+---------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
As you can see I specified the user nathacof, but ended up logging in as one of the default users who only have access to the test database.

I wanted to make sure nathacof was actually in the user table so I logged into mysql with the root username:

Code:
mysql> SELECT * FROM mysql.user WHERE User="nathacof";
+------+----------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| 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 | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections |
+------+----------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| %    | nathacof | *3F362E6315B674DE4C83FA7AF2F5C4F3F6067405 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                |          |            |             |              |             0 |           0 |               0 |                    0 |
+------+----------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
1 row in set (0.00 sec)

mysql>
(not sure how smart it is to put my password hash out there but I changed some digits for ya =D)

Any way if any one knows where I should be looking for answers I would greatly appreciate it.

Oh btw this is something I thought was a bit odd:
Code:
nathacof@confucious:~$ mysql
ERROR 1045 (28000): Access denied for user 'nathacof'@'localhost' (using password: NO)
nathacof@confucious:~$ mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36 to server version: 5.0.24a

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

mysql> show grants
    -> ;
+---------------------------------------------------------------------------------------------------------+
| Grants for @localhost                                                                                   |
+---------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' IDENTIFIED BY PASSWORD '*3F362E6314A694EE4C93FA7AF2F5C4F3F6067405' |
+---------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
Why does it recognize me as nathacof when attempting to access without using my password, but when I do specify the password I get logged in as ''@localhost?

Any help would be greatly appreciated.
 
Old 01-10-2007, 01:31 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Usually by default, MySQL allows access to the test database without passwords. It's usually recommended to remove what I call ghost accounts and drop the test database from existence.

mysql> use mysql
mysql> select * from user;

There's the list of all users, delete those that shouldn't belong
 
Old 01-10-2007, 11:59 PM   #3
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Original Poster
Rep: Reputation: 17
That did it. I removed those entries and every thing seems to be working fine.

Last edited by nathacof; 01-11-2007 at 12:03 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
phpmyadmin mysql user problems DoctorWynn Linux - Networking 3 06-01-2006 03:03 PM
The mythtvfrontend can't log into MySQL from any other user than the mythtv user! LiquidSlumber Linux - Software 1 03-24-2006 11:04 PM
Mysql User grant problems ubers0ldat Linux - Software 7 07-30-2003 12:33 AM
libnss-mysql (Store your UNIX user accounts in MySQL) markus1982 Linux - Security 0 01-26-2003 02:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration