After mysql is installed, there will be a database named mysql. The table for storing users is user, and the user management of mysql database is centered on this table. Of course there are some tables, such: tables_priv, procs_priv, clumns_priv,
Command summary for operating MySQL in Linux Command lines
(Note: commands in the MySQL environment are followed by a semicolon as the command Terminator)
1. commands for starting MySQL in Linux:
Mysqladmin start/Ect/init. d/mysql start (the
The user management method in the mysql command line shares bitsCN. after installing commysql, there will be a database named mysql. the table for storing users is user, and the user management of mysql database is centered on this table. of course,
How to connect to mysql using cmd
Connection: mysql-h host address-u user name-p user password (note: u and root do not need to add spaces, the same is true for others)Disconnected: exit (press enter)
Create authorization: grant select on database. *
Background: The mysql synchronization replication function (see the previous article http: blogcsdnnetkingofworldarticledetails39210937) is only a dual-host hot standby function and cannot automatically switch Mysql connections. The configuration of
When migrating a MySQL database, you sometimes need to migrate the users and permissions in the source database. For this migration, we can obtain the relevant permissions of users from the mysqluser table to generate corresponding SQL statements,
Linux MySQL commands to: http://my.oschina.net/wangwang110/blog/11108
The database is under/var/lib/mysql by default.
1. commands for starting mysql in linux:Mysqladmin start/Etc/init. d/mysql start (the installation path of mysql is earlier)
2.
This article describes how to quickly add multiple users and database skills to mysql by reading and executing commands in mysql. For more information, see the following code:
# Vi mysqlusers.txtCreate database dataname;Grant all privileges on
This article mainly introduces the script for exporting user permission settings in MySQL. to set the export permission for data in the user table, you can refer to the user and permission in the source database when migrating the MySQL database.
Mysql5.7 create user authorization delete user revocation authorization mysql5.7 cancel
1. Create a user:
Command:
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
Description: username-the username you will create, host-specifies the host on
Oracle and MySql knowledge SummaryHow SQL plus connects to the database1> enter sqlplus username/password @ database instance in cmdFor example, sqlplus system/lxr316 @ oracle,Sqlplus sys/admin as sysdba2> open sqlplus and enter the user name and
Export MySQL user permissions
When migrating a MySQL database, you sometimes need to migrate the users and permissions in the source database. For this migration, we can obtain the user's related permissions from the mysql. user table to generate
What is database links? Let's start by explaining what it does: enabling users to access another remote database from one database. Then database link is the connection information that stores the remote database. As shown in the following: The
Connection: Mysql-h host address-u user name-P user Password (note: U and root can be without spaces, others are the same)Disconnect: Exit (Enter)
Create authorization: Grant SELECT on database. * To User name @ login host identified by \ "Password
To prevent users from inserting from the library, use the Read-only parameter:
Configuration:
[Root@slave-mysql data]# grep read-only/etc/my.cnfread-only
Test process:
Master Library Licensing All
Mysql> Grant all on *.* to ' imbyrd ' @ '
One, the MySQL compilation installsPreparatory work1. Check if MySQL has been installed and uninstall it if it is recommended to use (-e).[Email protected] ~]# rpm-q mysql-server MySQL # #查看是否有安装过MySQL[Email protected] ~]# mount/dev/cdrom/mnt/#
1. View all users in MySQL databasemysql> SELECT DISTINCT CONCAT(‘User: ‘‘‘,user,‘‘‘@‘‘‘,host,‘‘‘;‘) AS query FROM mysql.user;+---------------------------------+| query |+---------------------------------+| User: ‘root‘@‘10.
To modify a new password:Use MySQL;Update user set password= ' new password ' where user= ' username ';Flush privileges; Update permissionsAdd new users:Grant SELECT, Insert,update,delete on database. Table to username @ Login host identified by '
First, create a regular user and authorize 1, create a user and authorize[[email protected] ~]# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.6.36 MySQL
Based on the mysql5.7.21 versionAside: Some commands if not available, please refer to the official version of the document, because, some of the command format, in the slowly obsolete (such as: IDENTIFIED BY PASSWORD ), or not recommended (such as:
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.