LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-21-2003, 09:11 AM   #1
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Rep: Reputation: 30
MySQL: how to see my priveleges?


What command should I run to find out: who I am in the database and my priveleges ?

Thanks
 
Old 06-22-2003, 02:35 PM   #2
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
i dont know how to find out "who you are". That should be known when you log in i guess , But the permissions database is the mysql database. It has many levels of permissions though. User level convering all databases, database level, table level and even record level. You'd have to run some SQL commands to get the permissions you have. I think the only user that has permission to this database however is the root user.

Other than that, I'm not sure if a user can obtain his/her permissions simply because they are kept in the mysql database.
 
Old 06-22-2003, 02:55 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
You can use the command:
Code:
show grants for USER@HOST;
phpMyAdmin is much easier if you have a webserver though.
 
Old 06-22-2003, 04:57 PM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
To see who you are, use:

select user();

To see what database you are connected to:

select database();
 
Old 06-22-2003, 06:50 PM   #5
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Original Poster
Rep: Reputation: 30
That's what my database says, but how can I add new user?

mysql> select user();
+----------------+
| user() |
+----------------+
| mike@localhost |
+----------------+
1 row in set (0.07 sec)

mysql> select database();
+------------+
| database() |
+------------+
| |
+------------+
1 row in set (0.00 sec)
 
Old 06-23-2003, 01:58 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Mysql Grant statement:
http://www.mysql.com/doc/en/GRANT.html
 
Old 06-23-2003, 08:44 PM   #7
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Original Poster
Rep: Reputation: 30
Solve the problem.. Need more help:

#1 MySQL is case sensitive or not ? When I change databases "use databasename" it is case sensitive, but when I create, drop, select it's not..
#2 How can I change host in the MYSQL ?

Thanks
 
Old 06-24-2003, 04:17 PM   #8
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
#1 MySQL is case sensitive or not ? When I change databases "use databasename" it is case sensitive, but when I create, drop, select it's not..
You gave most of the answer already.
Names of databases and tables are case-sensitive.
Names of columns, and the SQL keywords (like selEct, fRom...) ar not.
Quote:
#2 How can I change host in the MYSQL ?
With the -h (or --host) commandline option of mysql.
 
Old 06-24-2003, 10:35 PM   #9
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Original Poster
Rep: Reputation: 30
Is it possible to back up MySQL databases ?
 
Old 06-25-2003, 12:30 PM   #10
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Sure. See "man mysqldump".
You may also like to read about starting the mysql server with the --log option. You can use this in combination with the mysqldump options "--lock-tables" and "--flush-logs" to be able to recover a database passed the latest mysqldump back-up. Make sure the log is written to a different disk or even a different computer (i.e. using NFS), or make very regluar backups of the update log.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
additional data from the kernel to monitor the priveleges dudebaba Programming 0 03-02-2005 07:36 PM
folder priveleges keep getting changed Present Yoper 3 11-28-2004 02:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:33 PM.

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