Our Mission

L.A.M.P. refers to a toolset consisting of Linux + Apache + MySQL + PHP|Perl|Python|Postgresql... providing a powerful framework for rapid development of robust solutions. Each component is open source and has proven to be enterprise ready.

Navigation

Syndicate

Syndicate content

lampgroup.org

MySQL "SET Password" Help

Submitted by MaddTrin on Sat, 07/16/2005 - 8:35pm.

Basically, what I am trying to do is set up the ability to create dynamic web pages on my system(Win XP SP2). So I'm dealing with the "MP" of LAMP. After some serious persistence, I successfully installed PHP(I hope). However, when trying to follow the "Post-Install Instructions" for "MySQL" is were I run into some issues. The one thing that I am trying to accomplish is set my two user account passwords. I can't get to the MySQL shell, it denies me. "CMD" doesn't seen to do anything either. This is where I'm at:

*The following instructions describe how to set up passwords for the initial MySQL accounts, first for the anonymous accounts and then for the root accounts. Replace ``newpwd'' in the examples with the actual password that you want to use. The instructions also cover how to remove the anonymous accounts, should you prefer not to allow anonymous access at all.

You might want to defer setting the passwords until later, so that you don't need to specify them while you perform additional setup or testing. However, be sure to set them before using your installation for any real production work.

To assign passwords to the anonymous accounts, you can use either SET PASSWORD or UPDATE. In both cases, be sure to encrypt the password using the PASSWORD() function.

To use SET PASSWORD on Windows, do this:

shell> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR ''@'%' = PASSWORD('newpwd');

I'm lost and I'm about to pull out what hair is left on my head. Some help would be much appreciated.

*source -- http://dev.mysql.com/doc/mysql/en/default-privileges.html

GRANT privileges command

If I understand you correctly, there'no password set on the root account, part. If you're logged in as root, just type 'mysql' with no switches. You can also set a password using the mysqladmin utility from the command line. more">more

Use the GRANT and REVOKE commands, rather than SET SQL statements.

eg
mysql> GRANT ALL on dbname.* TO username identified by 'yourpasss'

Read more on GRANT statements until your understanding is crystal clear.
MySQL permissions are somewhat unintuitive at first. more

Since I never play with test accounts, I just delete them, not bothering to fix their permissions.

Enjoy.

User login

Who's online

There are currently 0 users and 1 guest online.

Who's new

Popular content

LAMP News