vim /var/log/mysqld.log
A temporary password is generated for [email protected]: yqtAhsIw/9MI
mysql -u root -p
password:yqtAhsIw/9MI
create user ‘aa01‘@‘192.168.100.140‘ identified by ‘123456‘; //给192.168.100.140创建用户,即创建的用户只能在192.168.100.140上登录
create database xyq; //创建xyq数据库
grant all privileges on xyq.* to ‘aa01‘@‘192.168.100.140‘; //给某个用户加上指定数据库的权限,*代表所有的表
mysql_install_db --datadir=/var/lib/mysql ///初始化数据库
时间: 2024-10-17 09:20:55