Fedora Linux Support Community & Resources Center
  #1  
Old 29th January 2007, 03:32 AM
scottp009 Offline
Registered User
 
Join Date: Aug 2006
Posts: 13
mysql user

hi,
I'm relatively knew to mysql. I was just wondering if i could get a little bit of help on the commands and such.

for example:
mysql> GRANT ALL PRIVILEGES ON 'database'.* TO 'web_user'@'localhost' IDENTIFIED BY 'thepassword';

what is the localhost? It sounds like a dumb question but i'm not exactly sure what to put there. Also i've been running this command using the url as local host and its been giving me an error saying
"Table 'mysql.user' doesn't exit"
What does this mean...I was under the impression that GRANT created a new user

Thankyou in advance for any help
Reply With Quote
  #2  
Old 29th January 2007, 04:31 AM
ppesci Offline
Registered User
 
Join Date: May 2006
Location: Caracas, Venezuela
Posts: 1,858
localhost is the name of your machine. I think GRANT creates the user in msql.user table.

type:

Quote:
use mysql;
show tables;
If you have an error or do not see the mysql.user, I tink you have problems with mysql instalation.
__________________
Pietro Pesci Feltri

PowerBook 15" G4 and
MacBook Pro 17" Intel Core 2 Duo
Intel I5 Desktop
Reply With Quote
  #3  
Old 29th January 2007, 04:38 AM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
Your computer has two kinds of personalities...localhost is the default built in name for the machine, akin to you referring to yourself as "me", instead of by name ("scottp009").

Now, when you set up your machine and its network interface card to communicate with other machines, you'd want to give it an IP address and "hostname", as it wouldn't make much sense to refer to itself as "me" on the network, since other machines know themselves as "me" (localhost) as well.

"Localhost" would also be tied to the loopback interface 127.0.0.1 on the machine...so communicating with the mysql daemon (service) locally, you are effectively talking to "localhost". You could envision this as thinking in your head, rather than communicating to others. This is called interprocess communications via a unix socket. Services/daemons
communicate via an IP address and a port (TCP/UDP), and on the local host it would be
IP 127.0.0.1: Port 3306 in the case of mysql.

Run the query "add new user to mysql" through google and you will get a bunch of answer.
Do read, it cannot be avoided.

Last edited by Zigzagcom; 29th January 2007 at 04:44 AM.
Reply With Quote
  #4  
Old 29th January 2007, 04:59 AM
scottp009 Offline
Registered User
 
Join Date: Aug 2006
Posts: 13
I did a bit of reading before I posted, mostly off the mysql homepage.

I tried to add a user by doing:
Quote:
mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
However when I write that command I get the same error, mysql.user doesn't exist.

When I type show databases I don't have a database called mysql.user but why is it looking to that table. I created another table and typed use nameoftable so I thought it would look to that.

thanks to both of you guys for the responses so far they've been a big help and thanks in advance to anything else you can tell me!
Reply With Quote
  #5  
Old 29th January 2007, 05:11 AM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,306
Your database was not installed correctly. mysql.user refers to a table named "user" in a database (you should call it a schema, not a database, it's more accurate) called 'mysql'. You should, by default, have mysql and information_schema listed when you "show databases"
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #6  
Old 29th January 2007, 05:13 AM
scottp009 Offline
Registered User
 
Join Date: Aug 2006
Posts: 13
ahh man...ok I think I actually may have deleted it by my own stupidity. I installed using yum and i'm pretty sure it was there and I deleted it myself. Is there anyway to add it back in or update or something using yum? Thanks a lot
Reply With Quote
  #7  
Old 29th January 2007, 05:16 AM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
Here are a couple of helpful sites:

http://fedoranews.org/cms/node/2425
http://stanton-finley.net/fedora_cor...ion_notes.html
http://www.debian-administration.org/articles/39
Reply With Quote
  #8  
Old 29th January 2007, 05:19 AM
scottp009 Offline
Registered User
 
Join Date: Aug 2006
Posts: 13
Thanks a lot for the sites...I used a site which looks almost identical to the first one on the list.
http://www.flmnh.ufl.edu/linux/install_apache.htm
Reply With Quote
  #9  
Old 29th January 2007, 05:30 AM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,306
If you think you deleted it, just reinstall. Remove the mysql-server rpm, then clean out anything that may be left behind in /var/lib/mysql, finally reinstall via yum. There's actually a script to create the default schema, but reinstalling would probably be easier based on your level of experience.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy

Last edited by brunson; 29th January 2007 at 05:32 AM. Reason: Ha, used "database" instead of "schema" myself. :-)
Reply With Quote
  #10  
Old 29th January 2007, 05:43 AM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
Just remember, after a fresh install, the default user for mysql is root, but no password has been set, so you can connect with:

Code:
[root@localhost ~]# mysql -u root
once you are at the prompt
Code:
>mysql
set the mysql password for root. This does not have to be the same as roots system password, it's actually better not to use the same system password. Remember to use the colon ; to end mysql statements. (Statements entered at the >mysql prompt)

The next time you log on as root, you need to use the -p switch as well:
Code:
[root@localhost ~]# mysql -u root -p
You will be promted for roots mysql password. You could enter the password after the -p switch, but it would be in clear text
Reply With Quote
  #11  
Old 29th January 2007, 05:55 AM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
Some basic commands:
Code:
>mysql show databases;
shows the databases...only the defaults in the beginning, "mysql" and "test".

Code:
>mysql use databasename;
which selects the database you want to work with.

Code:
>mysql show tables;
shows the tables of the selected database.

Code:
>mysql describe "tablename";
shows the field values of the colums of the table of interest.

Code:
>mysql show help;
You'll get there, no worries.
Reply With Quote
  #12  
Old 29th January 2007, 06:52 AM
scottp009 Offline
Registered User
 
Join Date: Aug 2006
Posts: 13
Thankyou sooo much...you guys have been a huge help! I know it must be frustrating working with such a newb like me. I really appreciate your help and i'm going to try to reinstall mysql and do it right this time!

Last edited by scottp009; 29th January 2007 at 07:14 AM.
Reply With Quote
  #13  
Old 29th January 2007, 07:09 AM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,306
You clearly stated your problem, showing examples and error messages, read the replies, tried the suggestions and provided feedback when requested. It was a good question to start with, I wish all the "newbies" on this forum would take a lesson from you. :-)
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
Reply

Tags
mysql, user

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL MAX Connection Per User gibz85 Servers & Networking 1 28th September 2009 10:50 AM
mysql............the user ....... hangweijin Servers & Networking 3 13th July 2007 04:33 PM
MySQL, PHP and Apache = Help new user cannot connect, but root user can?? judobrian Using Fedora 3 24th February 2007 01:12 AM
Add user to mysql whit a own database adapter Servers & Networking 2 1st August 2006 11:01 AM
mysql won't start (bad user) nrobison Servers & Networking 2 30th June 2006 04:12 AM


Current GMT-time: 11:19 (Friday, 25-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat