Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Servers
Reload this Page Create MySQL Users?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Servers Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Reply
 
Thread Tools Display Modes
Old 03-30-2003   #1 (permalink)
Linux Guru
 
Join Date: Apr 2003
Location: London, UK
Posts: 3,284
Create MySQL Users?

Hi.

I have a MySQL server running, but do not have PHPMyAdmin installed (and want to keep it like that for the mean time).

Within MySQL, i have a database named "backenddb".

I access MySQL using the Linux Comand Line mysql utility.

How do i add a mysql user the ability to login and work within the backenddb database only? - using the command line utility?

Cheers,

Jason
jasonlambert is offline   Reply With Quote
Old 03-30-2003   #2 (permalink)
flw
Linux Engineer
 
Join Date: Mar 2003
Location: U.S.A.
Posts: 1,025
Followup question is doesn't cron run as root? If so then you can run a script via cron or am I nuts or is it a bananna?
__________________
Dan

\"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"
flw is offline   Reply With Quote
Old 03-30-2003   #3 (permalink)
Just Joined!
 
Join Date: Mar 2003
Location: UK
Posts: 82
This would add the user 'newuser' with the password 'thepassword' and then give the user access to backenddb from any host with privelages to select, insert, update, delete, create and drop. Its not amazingly hard to userstand the bulk of it. So you'll be able to change anything you want or don't want quite easily.

This will need to be done as the root mysql user.

Code:
mysql> use mysql;
mysql> insert into 
         -> user (host, user, password)
         -> values('%','newuser',password('thepassword'));
mysql> insert into
      -> db (host,db,user,Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
      -> values ('%','backenddb','newuser','Y','Y','Y','Y','Y','Y');
mysql> quit

Ive never used the linux mysql util, but I am familer with mysql, and it all looks right from what I've learnt.

hope thats what you ment.
__________________
we\'ll smoke the monster out!
e_dreamer is offline   Reply With Quote
Old 03-30-2003   #4 (permalink)
Linux Guru
 
Join Date: Apr 2003
Location: London, UK
Posts: 3,284
yes that is what i ment, only problem is i cannot login with my newly created user, even if i specify the username, password, and the database to use as command line switches.

transcript of session:
Code:
root@london:/data/web/this_site_does_not_exist# mysql -u phpbb -p --database=backenddb
Enter password:
ERROR 1045: Access denied for user: 'phpbb@localhost' (Using password: YES)
root@london:/data/web/this_site_does_not_exist#
any ideas?
jasonlambert is offline   Reply With Quote
Old 03-30-2003   #5 (permalink)
flw
Linux Engineer
 
Join Date: Mar 2003
Location: U.S.A.
Posts: 1,025
Checkout http://www.experts-exchange.com/Data..._10516859.html threads may help or not. Just a idea.
__________________
Dan

\"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"
flw is offline   Reply With Quote
Old 08-13-2003   #6 (permalink)
Just Joined!
 
Join Date: Aug 2003
Posts: 5
Re: Create MySQL Users?

Quote:
Originally Posted by Jaguar
Hi.

I have a MySQL server running, but do not have PHPMyAdmin installed (and want to keep it like that for the mean time).

Within MySQL, i have a database named "backenddb".

I access MySQL using the Linux Comand Line mysql utility.

How do i add a mysql user the ability to login and work within the backenddb database only? - using the command line utility?

Cheers,

Jason
mysql> grant all privileges on backenddb.* to newuser@localhost identified by 'password' ;
notez is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 02:28 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0