Mysql account permission control and mysql permission Control
1. If we do not use the root account to operate the database, we may often encounter some permission problems. The following provides the simplest solution:
Grant all privileges on *.
Mysql account management 1. CREATE an account Shell code create user 'jeffre' @ 'localhost' identified by 'my pass'; www.2cto.com 2. delete an account (deleting an account also deletes all its permissions) shell code drop user 'Jeffrey '@ 'localhost'
1. Root user login to MySQL databasecode example:/usr/local/mysql/bin/mysql-u root-p (enter the password into MySQL)2. Go to MySQL and enter:code example:Use MySQL;3. View the user tablecode example:SELECT Host,user from User;Indicates the host name,
#1. Use phpMyAdmin to login MySQL and click on the Account menu, and then click on "Change the password", type your password you wan T to setup, such as: "123456"#2. Enter the Wampserver installation directory, such as F:\wamp64\apps\phpmyadmin4.5.2,
MySQL permissions are divided into global permissions, library permissions, table permissions, corresponding to the MySQL library inside the user table, DB table, Tables_priv table.Grant all privileges on *. *: Operation Mysql.user TableGrant all
"MYSQL account Management "You must connect root to the MySQL server as the MySQL user and which has the CREATE USER privilege. CREATE USERCreates a new row in the mysql.user table.Example 1:create An account that uses the default authentication
1, the right to give
Description: MySQL deployed on server A, internal network Host B through the client tools to connect server A for database operations, requires server A to give Host B operation MySQL permissions
1.1 Enter MySQL on Server A,
#0 Change the root passwordMysqladmin-u root-p Password yeqing#1 Delete Unused accountsSelect User,hostfrom mysql.user;Delete from Mysql.user where user! = ' root ';Delete from mysql.user where user = ' root ' and host= ' 127.0.0.1 ';Flush
One account Management1 Create an account:Example 1:Set up account ZWJ with all permissions on all databasesMysql> Grant All on * * to ' zwj ' @ ' 192.168.154.180 ';Query OK, 0 rows affected (0.01 sec)Set a password for ZWJMysql> Grant All on * * to
One, create the user:Command: CREATE USER ' username ' @ ' host ' identified by ' password ';Description: Username-the user name that you will create, host-Specifies which host the user can log on to, if localhost is available to local users, you
In practical applications ... Really need to add fixed permissions to the user, and set the corresponding password, so that the program moved to move, do not need to modify the source code, only need to add the same name to MySQL or other database
Use MySQLUpdate user SET Password = PASSWORD ('newpassword') where user = 'root ';Flush privileges;
1. Modify the user table of the MySQL database in the MySQL databaseYou can use normal update and insert statements.
2. Use the following command
Including the old client landing Mysql5.0 problemBecause the new version of Mysql5.0 used only MD5 encryption, so if the client is 3.5 version of the words to use the following statement to change the encrypted passwordmysql> SET PASSWORD for ' some_
Referenced from: http://blog.sina.com.cn/s/blog_682c287b0100ofz8.htmlThis is the approach under Linux ServerMethod One:1. Turn off MySQL # service mysqld stop2. Mask Permissions # Mysqld_safe--skip-grant-table screen appears: Starting demo from .....
MysqlIn general, the database is still a relatively easy-to-use database system, which is well received by many users. However, when there are problems with easy-to-use products, we will take the Mysql database as an example below, this section
1.mysql User creation:shell> MySQL--user=root MySQLMysql> GRANT all privileges in *.* to monty@localhost identified by ' something ' with GRANT OPTION;
Mysql> GRANT all privileges in *.* to monty@ "%" identified by ' something ' with GRANT OPTION;
MySQL to add new users can be done in two ways:
1. By way of the grant statement, we will explain this in the MySQL permissions below, which is simply an example.2. Direct operation of the MySQL authorization form (this method is now basically not
MySQL permissions control-allows users to connect remotelyMySQL for security, by default users are allowed to log on locally only, but in this case, you still need to use the user for remote connection, so that they can be remotely required to do
1. Create a new normal user--create statementsmysql> create user ' test1 ' @ ' localhost ' identified by ' test1 ';--Inserting with insertmysql> INSERT INTO Mysql.user (host,user,password,ssl_cipher,x509_issuer,x509_subject) VALUES (' localhost ', '
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.