# Ensure you have MySQL version 5.5.14 or later mysql --version
# Pick a MySQL root password (can be anything), type it and press enter # Retype the MySQL root password and press enter
# Secure your installation sudo mysql_secure_installation
# Login to MySQL mysql -u root -p
# Ensure you can use the InnoDB engine which is necessary to support long indexes # If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off" mysql> SET storage_engine=INNODB;
添加用户设置权限
1 2 3 4
mysql> create user username identified by ‘password'; #创建用户username mysql> show grants for username; #显示username权限 mysql> GRANT select,insert,update,delete,execute,create,drop ON *.* TO 'username'@'%' IDENTIFIED BY PASSWORD '*FF53393A7CDB3A4C6657A4E25092DA7DA41120BB’; #重新执行设置权限