Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Binary installation tutorial for mysql database

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the binary installation tutorial of mysql database, which involves things, learned from the theoretical knowledge, there are many books, literature for your reference, from a practical point of view, accumulated years of practical experience can be shared with you.

MySQL Database 1) create the mysql user's account # useradd mysql-s / sbin/nologin-M

Establish a fixed directory for all installed software

# mkdir-p / home/data/tools2) get MySQL package http://mirrors.sohu.com3) binary installation MySQL#tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz#mkdir-p / application/#mv mysql-5.5.49-linux2.6-x86_64 / application/mysql-5.5.49#ln-s / application/mysql-5.5.49 / application/mysql4) initialize MySQL configuration ask about the my .cnf # cd/application/mysql#\ cp support-files/my-small.cnf / etc/my.cnf5) initialize the MySQL database file # mkdir-p/application/mysql/data/#chown-Rmysql.mysql / application/mysql/

# / application/mysql/scripts/mysql_install_db\-basedir=/application/mysql\-datadir=/application/mysql/data\-user=mysql

Configure and start the MySQL database

1) set the MySQL startup script # cp support-files/mysql.server / etc/init.d/mysqld# chmod + x / etc/init.d/mysqld

2) the default installation command for MySQL binary is / usr/local/mysql, and the path to / usr/local/mysql in the startup script needs to be replaced.

# sed-iaccounspromotionUSERGUR _ localUniplex _ MySQL _ application _ application/mysql/bin/mysqld_safe/etc/init.d/mysqld\ /

3) start the MySQL database

# / etc/init.d/mysqld start

Or use the

# / application/mysql/bin/mysqld_safe-- user=mysql & > / etc/profile#source / etc/profile#echo $PATH/application/mysql/sbin:/usr/local/sbin:/usr/local/bin:/sbin:\ / bin:/usr/sbin:/usr/bin:/root/bin

8) Log in to MySQL test

# mysql show databases; select user (); quit

MySQL security configuration

1) set the password for the root user of MySQL

# mysqladmin-uroot password '123456'

2) Clean up useless MySQL users and libraries

> select user,home from mysql,user; > drop user "root" @ ":: 1"; > drop user "" @ "localhost"; > drop user "root" @ "www"; > drop user "" @ "www"; > select user,home from mysql,user; > flush privileges

Read the above mysql database binary installation tutorial introduction, hope to give you in the practical application of some help. Due to the limited space in this article, there will inevitably be deficiencies and areas that need to be supplemented. You can continue to pay attention to the industry information section and will update your industry news and knowledge regularly. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report