您的位置:首页 > 运维架构 > Linux

在linux系统的服务器上安装sql

2018-02-26 16:59 323 查看


在xshell连接到服务器后输入sudo su 进入root目录,逐条输入下面的指令,亲测及其好用

yum  -y install mysql mysql-server mysql-devel php-mysql

chkconfig --level 35 mysqld  on
/etc/init.d/mysqld  start
mysql_secure_installation
Enter current password for root (enter for none):    ----》默认为空密码直接回车
Set root password? [Y/n] y                                          ----》设置root密码
New password:
Re-enter new password:
Remove anonymous users? [Y/n] y                             ----》禁止匿名访问
Disallow root login remotely? [Y/n] y                         ----》不允许root远程访问
Remove test database and access to it? [Y/n] y          ----》删除测试数据库test
Reload privilege tables now? [Y/n] y                           ----》重新加载授权信息
创建的名为mysql数据库中就会存在新创建的用户信息,保存用户信息的数据库名字一般为user,这里创建的是mysql,用户名一般为root,密码可以设置也可以为空
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: