Unix Technical Forum

SQL Question -r -root

This is a discussion on SQL Question -r -root within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I was trying to figure out grant tables, and I've somehow changed something about SQL on my server. Before, ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 08:48 PM
samson
 
Posts: n/a
Default SQL Question -r -root

I was trying to figure out grant tables, and I've somehow changed
something about SQL on my server.

Before, I could use the command ">mysql -r -p" and grant or revoke.

But now I have to use ">mysql -root -p". Otherwise, SQL denies access.

What happened?

Thanks.

S.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 08:48 PM
Thomas Ronayne
 
Posts: n/a
Default Re: SQL Question -r -root

samson wrote:
> I was trying to figure out grant tables, and I've somehow changed
> something about SQL on my server.
>
> Before, I could use the command ">mysql -r -p" and grant or revoke.
>
> But now I have to use ">mysql -root -p". Otherwise, SQL denies access.
>
> What happened?
>
> Thanks.
>
> S.
>

You set things the way they're supposed to be -- when MySQL is first
installed, it's wide-open and you fix that by setting a password for the
root user and deleting the anonymous user (you did delete the anonymous
user, right?). If you connect to the mysql data base and "select * from
user" there will be two rows for root, one localhost, one the name of
your server and the password column will have encrypted entries.

What you're getting is the way it's supposed to work. Go take a look at
"Post-installation Setup and Testing," in the MySQL manual for more
information.

--
Everything works -- if you let it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 08:48 PM
samson
 
Posts: n/a
Default Re: SQL Question -r -root

In article <sWluh.35832$QU1.26060@newssvr22.news.prodigy.net> ,
trona@REMOVETHISameritech.net says...
> samson wrote:
> > I was trying to figure out grant tables, and I've somehow changed
> > something about SQL on my server.
> >
> > Before, I could use the command ">mysql -r -p" and grant or revoke.
> >
> > But now I have to use ">mysql -root -p". Otherwise, SQL denies access.
> >
> > What happened?
> >
> > Thanks.
> >
> > S.
> >

> You set things the way they're supposed to be -- when MySQL is first
> installed, it's wide-open and you fix that by setting a password for the
> root user and deleting the anonymous user (you did delete the anonymous
> user, right?). If you connect to the mysql data base and "select * from
> user" there will be two rows for root, one localhost, one the name of
> your server and the password column will have encrypted entries.
>
> What you're getting is the way it's supposed to work. Go take a look at
> "Post-installation Setup and Testing," in the MySQL manual for more
> information.
>
>


I'm going through the post-installation. Thanks for the direction.

I can log on to the sql server just fine using -uroot and -pPASSWORD,
but once I'm in, I can't issue grant privileges. I'm getting
a 1045 error. Example:

# mysql -u root mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26 to server version: 5.0.11-beta-log

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

mysql> grant all privileges on *.* to 'root'@'localhost' identified by
'INSERTEDPASSWORD' with grant option;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: YES)

Any suggestions?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 08:48 PM
Thomas Ronayne
 
Posts: n/a
Default Re: SQL Question -r -root

samson wrote:
> In article <sWluh.35832$QU1.26060@newssvr22.news.prodigy.net> ,
> trona@REMOVETHISameritech.net says...
>
> I'm going through the post-installation. Thanks for the direction.
>
> I can log on to the sql server just fine using -uroot and -pPASSWORD,
> but once I'm in, I can't issue grant privileges. I'm getting
> a 1045 error. Example:
>
> # mysql -u root mysql -p
> Enter password:
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 26 to server version: 5.0.11-beta-log
>
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
> mysql> grant all privileges on *.* to 'root'@'localhost' identified by
> 'INSERTEDPASSWORD' with grant option;
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
> password: YES)
>
> Any suggestions?
>
> Thanks.
>

Did you, logged in as root (system root, not MySQL root), first thing,
before you did ANYTHING else, run

mysql_install_db --user=mysql

Did you remove the anonymous user

mysql -u root
delete from mysql.user where user = '';
flush_privileges;

Did you assign passwords to the root account

*|mysql -u root|*
*|set password for 'root'@'localhost' = password('/|newpwd|/');|*
*|set password for 'root'@'/|host_name|/' = password('/|newpwd|/');|*

*||*Have you added any non-root users (see section 5.9 of the manual).

If you didn't start up as described in the Post-installation
instructions -- and you have not yet added any data bases -- it might be
easier to simply blow the data base away and start over clean with
"mysql_install_db --user=mysql" (you do not have to reinstall MySQL).
You can do that by, logged in as root, running this (but, don't do this
if you have created a data base of your own -- it'll go to the Great
Byte Bucket in the Sky):

/etc/rc.d/rc.mysqld stop
cd /opt/lib
rm -r mysql
mysql_install_db --user=mysql
/etc/rc.d/rc.mysqld start

Then follow the direction in the Post-installation to the letter. Once
you've got that going, be sure to follow the instructions for adding
users (that's in section 5.9 of the manual). Don't grant permissions
like you show above.

Hope this helps some.

--
Everything works -- if you let it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com