mysql数据库二进制_Mysql数据库简单安装(二进制)
二進制安裝:
[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
創建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
初始化數據庫文件
[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?|
+------+-----------+
本文出自 “大夢初醒” 博客,請務必保留此出處http://bestlufeng.blog.51cto.com/11790256/1912674
Mysql數據庫簡單安裝(二進制)
標簽:數據庫???mysql???二進制
本條技術文章來源于互聯網,如果無意侵犯您的權益請點擊此處反饋版權投訴
本文系統來源:http://bestlufeng.blog.51cto.com/11790256/1912674
總結
以上是生活随笔為你收集整理的mysql数据库二进制_Mysql数据库简单安装(二进制)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: updatebyprimarykeyse
- 下一篇: java约瑟夫环迭代器_Josephus