mysql安装
- 下载mysql
mysql下载地址 - 安装mysql
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
mariadb-libs-5.5.52-1.el7.x86_64
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
[root@centos110 mysql]
error: Failed dependencies:
libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.27-1.el7.x86_64
libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.27-1.el7.x86_64
libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.27-1.el7.x86_64
[root@VM-0-4-centos mysql]
[root@centos110 mysql]
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Sun 2021-05-09 07:12:28 EDT; 2s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 1025 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 973 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 1049 (code=exited, status=0/SUCCESS)
May 09 07:04:01 Centos110 systemd[1]: Starting MySQL Server...
May 09 07:04:02 Centos110 systemd[1]: Started MySQL Server.
May 09 07:12:27 Centos110 systemd[1]: Stopping MySQL Server...
May 09 07:12:28 Centos110 systemd[1]: Stopped MySQL Server.
[root@centos110 mysql]
[root@Centos110 mysql]
2021-04-19T14:04:52.796208Z 1 [Note] A temporary password is generated for root@localhost: >+Xr&s1:V;
[root@Centos110 mysql]
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)
[root@Centos110 mysql]
mysql创建用户和授权
create user 'username'@'host' identified by 'password';
drop user 'username'@'host'
create database databaseName;
grant privileges on databaseName.tableName to 'username'@'host';
revoke privileges on databaseName.tableName from 'username'@'host';