MySQL installation configuration under Linux

Source: Internet
Author: User

MySQL database mysql database mysql database mysql database mysql databases

Installation steps for MySQL under Linux: 1. Installation Preparation: 1. Ensure that the Linux server has basic development tools.  Server Adoption-Basic service installation (without minimal installation) >> Custom installation Tools >> Basic system inside remove Java Option >> Basic System check Basic to see if there are tools such as Vim and setup selected. 2. Ensure that the service has access to the extranet. Ping www.baidu.com 3. Uninstall the system comes with MySQL, not skipped. 1. Find out if MySQL command was previously installed: Rpm-qa|grep-i MySQL can see two of MySQL's packages: mysql-4.1.12-3.rhel4.1mysqlclient10-3.23.58-4.rhel4.12, Delete mysql Delete command: rpm-e--nodeps package name (Rpm-ev mysql-4.1.12-3.rhel4.1) 3, delete the old version of MySQL development header file and Library command: rm-fr/usr/lib/mysqlrm-fr/usr/i Nclude/mysql Note: After uninstalling the/var/lib/mysql data and/etc/my.cnf will not be deleted, if the determination is not used manually delete rm-f/etc/my.cnfrm-fr/var/lib/mysql//pm-va-- Nofiles--nodigest//yum Remove Libmysql//yum remove postfix or execute this command to remove the Mysqlyum remove *mysql*2 that the system already has. Download the appropriate version mysql-community-release-el6-5.noarch.rpm 1. Direct download.   www.mysql.com >>downkiads>>yum repositotyy>> downkiads>>no Thanks, just start my download. 2. Download with wget. wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm Yum Repositoryumyum Repositoryyum Repository Repository3. Installing mysql-community-release-el6-5.noarch.rpm   RPM-IVH mysql-community-release-el6-5.noarch.rpm4. Installing the MySQL service yum install mysql-community-server will install many dependent three-party packages, which can take a long time. 5. After the installation is complete, start Mysqlservice mysqld start6. Initialize the database and root password--delete anonymous user--ban root telnet--delete test data and access him--now reload the privilege table? Mysql_secure_installation then follow the prompts to set the step by step, as follows: first let input root password, at this time the database is the initial state, so no password, direct return to set root password? [y/n] yremove anonymous users? [y/n] Ydisallow root login remotely? [y/n] Nremove test database and access to it? [y/n] nreload privilege tables now? [y/n] Y then modify telnet mysql-uroot-p use MySQL//switch MySQL database update user set host= '% ' where host= ' localhost '; 7. Modify the configuration file/etc/my.cn F, add the following character_set_server=utf8skip-name-resolve8. Restart MySQL to make it effective [[email protected] ~]# service mysqld Restart9. Create the database and import the SQL file. Mysql-u root-p//log in to the database by password Create DB Wifidata//creation Wifidata database use Wifidata//toggle Wifidata Database source/root/soft/ Wifidata.sql// Import the Wifidata.sql file--------------------------------------------------------------------------------------------------------- ------------------------------------Second, mysql5.7 offline installation 1. Prepare all the installation packages required for MySQL5.7. 2. Delete all the MySQL packages on the system: Yum remove *mysql-lib*3. Install using the RPM-IVH command: RPM-IVH mysql-community-common-5.7.10-1.el6.x86_64. rpmmysql-community-libs-5.7.10-1.el6.x86_64.rpm mysql-community-libs-compat-5.7.10-1.el6.x86_64.rpm  mysql-community-devel-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-server-5.7.10-1.el6.x86_64.rpm 4. In/etc/my.cnf add: Validate-password=off5. Start Mysql:service msyqld start6. Find MySQL default password: grep ' temporary password '/var/log/mysqld.log7. Log in to MySQL: The password for the first 6-Step search: Mysql-uroot-p 8. Set a new password: ALTER user ' root ' @ ' localhost ' identified by ' 123456 '; 9. Modify Telnet: Use MySQL, update USER set host= '% '; 10. Restart MySQL is the above settings Entry into force: service mysqld restart;------------------------------------------------ MySQL common commands------------------------------------------------mysql start and stop sevice mysqld startsevice mysqld Stopmysql log in as a user password mysql-u root-p create a database wifidata switch database use wifidata Import Database file source/root/soft/ Wifidata.sql

  

MySQL installation configuration under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.