Database Reference
In-Depth Information
[mysql.client]
default-character-set=utf8
As a beginner, you probably won't need to make any changes to the server's configuration
file. For now, just know that the configuration file exists, where it's located on your serv-
er, and how to change settings. What is necessary is to set the password for the MySQL
user, root . It's initially blank.
Setting Initial Password for root
You can change thepassword for the root user in MySQL in a few ways. One way is to
use the administrationutility, mysqladmin . Enter the following from the command line:
mysqladmin -u root -p flush-privileges password " new_pwd "
Replace the word new_pwd in quotes with a strong password that you want to use for
root . If you get a message saying something like, mysqladmin command is not found , it
may be because you didn't make a symbolic link to the MySQL directory where mysqlad-
min is located or you haven't added it to your command path. See the instructions for the
distribution you installed on how to do one or the other. For now, you can just add the file
path to the preceding line and re-enter it. On Linux and other Unix like systems, try run-
ning the command as /usr/local/mysql/bin/mysqladmin . On a Windows system, try
c:\mysql\bin\mysqladmin .
If you're working on a networked server, though, it's better not to enter a password in this
way. Someone might be looking over your shoulder or may find it in the server logs later.
As of version 5.5.3 of MySQL, you can and should enter it like this:
mysqladmin -u root -p flush-privileges password
After entering this line, you will be prompted for the old password, which will be initially
blank, so press the Enter key. Then you will be prompted to enter the new password twice.
By this method, the password you enter won't be displayed on the screen as you type it. If
everything was installed properly and if the mysqld daemon is running, you should not get
any message in response.
The MySQL user root is completely different from the operating system's root user, even
though it has the same name. It is meaningful only within MySQL or MariaDB.
Throughout this topic, I will be referring to this MySQL user by default when I use the
term root . On the rare occasion where I have to refer to the operating system root user, I
will explain that.
Search WWH ::




Custom Search