?
Solved

help for newbee to mysql

Posted on 2012-09-13
15
Medium Priority
?
480 Views
Last Modified: 2012-09-13
I have taken over a linux web server and need help accessing the user database.  I type the command to SELECT * FROM mysql.users but get nothing just a return to the prompt.
0
Comment
Question by:cmsheps
  • 7
  • 5
  • 3
15 Comments
 
LVL 23

Assisted Solution

by:savone
savone earned 1332 total points
ID: 38395151
at the mysql prompt use the following commands:

use mysql;

select * from user;
0
 
LVL 23

Expert Comment

by:savone
ID: 38395154
or you can use:

select * from mysql.user

Its user not user(s)
0
 

Author Comment

by:cmsheps
ID: 38395179
I tried use mysql then select * from user and still it goes back to the prompt without listing any users
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:jhheider
jhheider earned 668 total points
ID: 38395183
You can do:

use mysql;
SHOW TABLES;

to see the tables. If you want something a little simpler than the command-line, there's always phpMyAdmin.
0
 

Author Comment

by:cmsheps
ID: 38395185
I am using putty to access the web server.  I am typing the commands at the mysql> prompt
0
 
LVL 23

Expert Comment

by:savone
ID: 38395204
Are you logging in to mysql as root or someone with permissions to see the mysql db?
0
 

Author Comment

by:cmsheps
ID: 38395217
I have tried
use mysql;
SHOW TABLES;
but I it still goes back to the prompt without displaying anything
0
 
LVL 3

Expert Comment

by:jhheider
ID: 38395228
If you have root/a user with proper permissions, you should see something like this:

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| event                     |
| func                      |
| general_log               |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| servers                   |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
24 rows in set (0.00 sec)

Open in new window


Are you logging into mysql with:

mysql -u root -p

Open in new window


or some other way?
0
 

Author Comment

by:cmsheps
ID: 38395255
I am logging on with another user
0
 
LVL 23

Accepted Solution

by:
savone earned 1332 total points
ID: 38395263
That user does not have permissions then.  You need to log in as root, or someone with permissions to see the mysql db.
0
 

Author Comment

by:cmsheps
ID: 38395278
I log on with

mysql -u username -p
0
 

Author Comment

by:cmsheps
ID: 38395294
I do not have the root password
0
 
LVL 23

Expert Comment

by:savone
ID: 38395312
Then you can not do anything.  Either get the root password or have someone with the root password create an account for you with the necessary privileges.
0
 
LVL 3

Expert Comment

by:jhheider
ID: 38395346
Or you can recover the root password, if you have root access to the server:

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

Author Closing Comment

by:cmsheps
ID: 38396085
thanks for all your help.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question