標籤:資料庫 mysql 二進位
二進位安裝:[[email protected] ~]# mkdir /home/lufeng/tools -p[[email protected] ~]# cd /home/lufeng/tools [[email protected] tools]# rz[[email protected] tools]# tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz[[email protected] tools]# mkdir -p /application/mysql-5.5.49[[email protected] tools]# mv mysql-5.5.49-linux2.6-x86_64 /application/mysql-5.5.49建立mysql使用者|組[[email protected] tools]# groupadd mysql[[email protected] tools]# useradd mysql -g mysql -s /sbin/nologin -M初始化設定檔[[email protected] tools]# ln -s /application/mysql-5.5.49/ /application/mysql[[email protected] tools]# cd /application/mysql[[email protected] mysql]# cp support-files/my-small.cnf /etc/my.cnf初始化資料庫檔案[[email protected] mysql]# mkdir -p /application/mysql/data[[email protected] mysql]# chown -R mysql.mysql /application/mysql/[[email protected] mysql]# /application/mysql/scripts/mysql_install_db --basedir=/application//mysql --datadir=/application/mysql/data --user=mysql配置並啟動mysql[[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysqld[[email protected] mysql]# chmod +x /etc/init.d/mysqld[email protected] mysql]# sed -i ‘s#/usr/local/mysql#/application/mysql#g‘ /application/mysql/bin/mysqld_safe /etc/init.d/mysqld[[email protected] mysql]# /etc/init.d/mysqld startStarting MySQL... SUCCESS! [[email protected] mysql]# netstat -lntup|grep mysqltcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2951/mysqld 配置全域使用路徑[[email protected] ~]# echo ‘export PATH=/application/mysql/bin:$PATH‘ >>/etc/profile[[email protected] ~]# tail -1 /etc/profileexport PATH=/application/mysql/bin:$PATH[[email protected] ~]# 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安全配置:[[email protected] ~]# mysqladmin -u root password ‘199429‘[[email protected] ~]# mysqlERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)[[email protected] ~]# mysql -uroot -p刪除多餘使用者:+------+-----------+| user | host |+------+-----------+| root | 127.0.0.1 || root | localhost |+------+-----------+
本文出自 “大夢初醒” 部落格,請務必保留此出處http://bestlufeng.blog.51cto.com/11790256/1912674
Mysql資料庫簡單安裝(二進位)