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, ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| |||
| 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. |
| |||
| 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. |
| ||||
| 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. |