创建mysql用户和组 [root@localhost root]# groupadd mysql [root@localhost root]# useradd -g mysql mysql //解压安装包 # tar zxvf mysql 5.6.16.tar.gz # mv mysql 5.6.16.tar.gz/usr/local //进入/usr/local #cd /usr/local # ln -s mysql 5.6.16.tar.gz /usr/local/mysql #scripts/mysql_install_db --user=mysql # chown -R root . # chown -R mysql data # chown -R mysql . //启动MySQL #bin/mysqld_safe --user=mysql & [root@localhost mysql]# cd bin [root@localhost bin]# ./mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version:5.6.16-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> 默认root用户密码为空,为了保证数据库的安全需要为root用户设置密码: # ./mysqladmin -u root password ‘password’
不知道有没有问题??