Cloud computing learning material framework, msyql advanced operation courseware
In this article, we will explain the advanced operation of msyql:
Connect to the database
Mysql-uroot-p-h20.18.44.209-p3306
Authorization
GRANT ALL PRIVILEGES ON. TO 'root'@'%' WITH GRANT OPTION
FLUSH PRIVILEGES
Modify database password
Vim / etc/my.cnf append
Validate_password=off
Systemctl restart mysqld
Method 1:
Mysql > SET PASSWORD FOR user3@'localhost'='new_password'
Mysql > flush privileges
Method 2:
Mysql > update mysql.user set password=password ('newpassword') where user='root'
Mysql > flush privileges
Method 3:
Mysql > set password for 'root'@'localhost'=password (' newpassord')
Compilation and installation requires parameters
[root@mysql-5.7.17] # cmake. \
-DWITH_BOOST=boost_1_59_0/\ specify the boost directory
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\ specify the installation directory
-DSYSCONFDIR=/etc\ profile location
-DMYSQL_DATADIR=/usr/local/mysql/data\ data directory (very important error log, data storage location)
-DINSTALL_MANDIR=/usr/share/man\ man manual
-DMYSQL_TCP_PORT=3306\ default port 3306
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock\ sock file location, used for network communication
-default support for DDEFAULT_CHARSET=utf8\ character set
-DEXTRA_CHARSETS=all\ character set support extension support
-DDEFAULT_COLLATION=utf8_general_ci\ character set support sets default collation
-DWITH_READLINE=1\ can pan-history commands
-DWITH_SSL=system\ Log in using certificate (security but affect transmission speed)
-DWITH_EMBEDDED_SERVER=1\ compile embedded server support
-DENABLED_LOCAL_INFILE=1\ supports import from native
-Library of how DWITH_INNOBASE_STORAGE_ENGINE=1 default engine data is stored