MySQL(管理)安装

时间:2022-06-12 03:51:22

 

--linux:
yum -y install mariadb mariadb-server
OR
yum -y install mysql mysql-server
 --windows:
http://dev.mysql.com/downloads/mysql/
--启动
service mysqld start  --开启
chkconfig mysqld on   --设置开机自启
OR
systemctl start mariadb
systemctl enable mariadb
--查看
ps aux |grep mysqld   --查看进程
netstat -an |grep 3306 --查看端口
--设置密码
mysqladmin -uroot password ‘123‘   --设置初始密码,初始密码为空因此-p选项没有用
mysqladmin -u root -p123 password ‘1234‘ --修改root用户密码
--登录
mysql               --本地登录,默认用户root,空密码,用户为[email protected]
mysql -u root -p 1234 --本地登录,指定用户名和密码,用户为[email protected]
mysql -u root -p 1234 -h 192.168.31.95 --远程登录,用户为[email protected]