MySQL configuration in Linux (RPM installation)

Source: Internet
Author: User
Install RMP-IVH MySQL-server-4.1.22-0.glibc23.i386.rpm -- nodeps
RMP-IVH MySQL-client-4.1.22-0.glibc23.i386.rpm -- nodeps

Check whetherInstallSuccessful

Netstat-atln

If the port 3306 is opened, the installation is successful.Login

MySQL [-u username] [-H host] [-P [Password] [dbname]

 

No password at first, The MySQL Executable File /Usr/bin/MySQL Directory 1. Database directory /Var/lib/MySQL/ 2. Configuration File /Usr/share/MySQL (MySQL. Server commands and configuration files) 3. Related commands /Usr/bin (Mysqladmin mysqldump and other commands) 4. Start the script /Etc/rc. d/init. d/ (Start the MySQL directory of the script file) Change logon Password MySQL has no password by default.

Usr/bin/mysqladmin-u Root Password 'new-password' format:

Mysqladmin-u username-P old Password New Password

Start and StopAfter MySQL is installed, start the file MySql in/Etc/init. dDirectory, run the following command when you need to startStart:

/Etc/init. d/MySQL start

Stop:/Usr/bin/mysqladmin-u root-P Shutdown

Restart:

Sudo/etc/init. d/MySQL restart

 

Automatic Start: Check whether MySQL is in the Auto Start List /Sbin/chkconfig -- list Add MySQL to the startup Service Group of your system /Sbin/chkconfig -- add MySQL Delete MySQL from the startup Service Group /Sbin/chkconfig -- del MySQL Configuration Set /Usr/share/MySQL/my-medium.cnf. Copy /Etc/My. CNF , Modify later My. CNF File to modify the global settings of MySQL In the my. CNF file Innodb_flush_log_at_trx_commit Set 0 To optimize

  [Mysqld] And then addLower_case_table_namesSet1To make the table name case insensitive.

Set Character Set The default encoding of MySQL is Latin1, which does not support Chinese characters. To support it, you must change the default encoding of the database to GBK or utf8. 1. Stop the MySQL Service ( Bin/mysqladmin-u root shutdown) 2. Find my. CNF under/etc/, if not, copy the my-medium.cnf under the support-Files directory under the installation directory of MySQL to/etc/and rename it My. CNF 3. After opening my. CNF, add Default-character-set = utf8 , Save and close 4. Start the MySQL Service ( Bin/mysqld_safe &) Query character set: Show variables like '% set % '; Add mysql users Format:

Grant select on database. * To username @ login host identified by "password"

Grant select, insert, update, delete on *. * To user_1 @ '%' identified by '123 ';
Grant all on *. * To user_1 @ 'localhost' identified by '20140901 ';Remote Access1:

Grant all privileges on *. * To xoops_root @ '%' identified by '123 ';

Allows the xoops_root user to log on to MySQL from any machine.Second:Edit/Etc/MySQL/My. CNF> Skip-networking => # Skip-networkingThis allows other machines to access MySQL.

Grant all on *. * To 'root' @ 'IP' identified by 'Password ';

Backup and recovery Backup Go to the library directory, CD/Val/lib/MySQL

Mysqldump-u root-p -- opt AAA> back_aaa

RestoreMysql-u root-p ccc <back_aaa

 

 

 

 

 

 

 

 

 

InstallRMP-IVH MySQL-server-4.1.22-0.glibc23.i386.rpm -- nodeps
RMP-IVH MySQL-client-4.1.22-0.glibc23.i386.rpm -- nodeps

Check whetherInstallSuccessful

Netstat-atln

If the port 3306 is opened, the installation is successful.Login

MySQL [-u username] [-H host] [-P [Password] [dbname]

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.