Learning Mysql


-> IDENTIFIED BY PASSWORD '*14E65567ABDB5135D0CFD9A70B3032C179A49EE7'



Download 4.24 Mb.
View original pdf
Page301/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   297   298   299   300   301   302   303   304   ...   366
Learning MySQL
-> IDENTIFIED BY PASSWORD '*14E65567ABDB5135D0CFD9A70B3032C179A49EE7';
Query OK, 0 rows affected (0.00 sec)
The
PASSWORD
keyword stores the hashed string directly, rather than passing it through the PASSWORD function. You’ll recall from earlier that the plain-text password was actually
the_password
, and you’ll find you can now connect using it mysql --user=partmusic --password=the_password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 60 to server version 5.0.22-standard-log
Type 'help' or 'h' for help. Type 'c' to clear the buffer.
mysql>
You can also manually set a password to its hashed version by using the SET PASS
WORD
statement without the PASSWORD function as follows:
Understanding and Changing Passwords | 327

mysql> SET PASSWORD FOR 'partmusic'@'localhost' =
'*14E65567ABDB5135D0CFD9A70B3032C179A49EE7'
Query OK, 0 rows affected (0.00 sec)
Again, you can now connect using the plain-text password
the_password
The Default Users
This section explains the user accounts that are created when MySQL is installed and shows you how to secure your installation by making important changes to these default settings. The next section explains how to put together the things you’ve learned to develop a complete user security policy.
When you install your MySQL server, it comes preconfigured with one or two default users. The privileges of these users and the locations vary between operating systems,
but you must ensure that their privileges match your requirements, and make decisions about the machines that connections to your database server can come from you might also decide to remove one or more of the default users. Before we explain how to make these decisions, let’s discuss the users and how they access the server.
On all platforms, MySQL may come installed with two users:
root
This is the superuser, who can do anything to the server, users, databases, and data. The superuser usually creates new users who have authority to access and manipulate specific databases. Once you’ve installed MySQL, you must configure the root user, and we show you how to do this later in this section.
anonymous
This user has no username you can use it to connect to the server without supplying any credentials. Also, as described earlier in Anonymous Users it is used when host credentials match but the requested username doesn’t. The anonymous user has very limited privileges by default in the next section, we’ll explain what these are.
Both users have no password by default. With the anonymous user, this means you can connect to the database server without a username and password. For the root user, you supply the username root, but there’s no password. Again, these are user accounts on the MySQL server, not on the operating system (Linux, Windows, or Mac
OS X).

Download 4.24 Mb.

Share with your friends:
1   ...   297   298   299   300   301   302   303   304   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page