您好,登錄后才能下訂單哦!
二進制安裝: [root@lufengcentos ~]# mkdir /home/lufeng/tools -p [root@lufengcentos ~]# cd /home/lufeng/tools [root@lufengcentos tools]# rz [root@lufengcentos tools]# tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz [root@lufengcentos tools]# mkdir -p /application/mysql-5.5.49 [root@lufengcentos tools]# mv mysql-5.5.49-linux2.6-x86_64 /application/mysql-5.5.49 創(chuàng)建mysql用戶|組 [root@lufengcentos tools]# groupadd mysql [root@lufengcentos tools]# useradd mysql -g mysql -s /sbin/nologin -M 初始化配置文件 [root@lufengcentos tools]# ln -s /application/mysql-5.5.49/ /application/mysql [root@lufengcentos tools]# cd /application/mysql [root@lufengcentos mysql]# cp support-files/my-small.cnf /etc/my.cnf 初始化數(shù)據(jù)庫文件 [root@lufengcentos mysql]# mkdir -p /application/mysql/data [root@lufengcentos mysql]# chown -R mysql.mysql /application/mysql/ [root@lufengcentos mysql]# /application/mysql/scripts/mysql_install_db --basedir=/application//mysql --datadir=/application/mysql/data --user=mysql 配置并啟動mysql [root@lufengcentos mysql]# cp support-files/mysql.server /etc/init.d/mysqld [root@lufengcentos mysql]# chmod +x /etc/init.d/mysqld root@lufengcentos mysql]# sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld [root@lufengcentos mysql]# /etc/init.d/mysqld start Starting MySQL... SUCCESS! [root@lufengcentos mysql]# netstat -lntup|grep mysql tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2951/mysqld 配置全局使用路徑 [root@Mysql-server ~]# echo 'export PATH=/application/mysql/bin:$PATH' >>/etc/profile [root@Mysql-server ~]# tail -1 /etc/profile export PATH=/application/mysql/bin:$PATH [root@Mysql-server ~]# echo $PATH /application/mysql/bin:/applicaion/mysql/bin:/applicaion/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin 安全配置: [root@Mysql-server ~]# mysqladmin -u root password '199429' [root@Mysql-server ~]# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [root@Mysql-server ~]# mysql -uroot -p 刪除多余用戶: +------+-----------+ | user | host | +------+-----------+ | root | 127.0.0.1 | | root | localhost | +------+-----------+
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。