[Tutorial]centos Uninstall, install MySQL (source compiled installation method)

Source: Internet
Author: User

-----------1 Uninstalling the system comes with MSYQL package
Rpm-qa|grep MySQL


RPM-E--nodeps mysql-server-5.1.71-1.el6.x86_64--forced uninstall MySQL Installer
Rpm-e mysql-server-5.1.71-1.el6.x86_64--dependency, unable to unload


----------2 install CMake compile software mysql5.6 start not using Configure mode
Yum-y Install CMake make


----------3 Install MySQL dependency package, other Linux need software download compile install
Yum install gcc gcc-c++ autoconf bison automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*-y


----------4 Create a MySQL directory to hold logs and data files, and change the directory owner
Mkdir/mysql
Mkdir/mysql/data
Mkdir/mysql/logs
Mkdir/mysql/data/socket
Chown Mysql.mysql-r/mysql

----------5 Creating a MySQL user does not allow logging on to the system
Groupadd MySQL
Useradd mysql-g mysql-s/sbin/nologin


----------6 decompression (need to switch to Mysql-5.6.19.tar.gz's storage directory)
TAR-ZXVF mysql-5.6.19.tar.gz


----------7 into MySQL extract directory
CD mysql-5.6.19


----------8 Compilation
Cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_unix_addr=/mysql/data/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_extra_charsets:string=utf8 \
-dwith_innobase_storage_engine=1 \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dmysql_datadir=/mysql/data/\
-dmysql_user=root \
-dmysql_tcp_port=3306

---------9 Make Installation
Make

---------Make Installation
Make install

---------11 Load Start command path system startup directory
CP Support-files/mysql.server/etc/init.d/mysqld
chmod 755/etc/init.d/mysqld

---------12 is set to boot chkconfig--list|grep mysqld detection is set to boot
Chkconfig mysqld on


---------13 copy MySQL command path system environment variables
Cp/usr/local/mysql/bin/mysql/usr/bin/mysql
Cp/usr/local/mysql/bin/mysql/usr/local/bin/mysql

---------14 Initialize the MySQL system database (need to go back to/root directory execution)
./usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/mysql/data

---------mysql Password change-------------------------
> Use MySQL;
> UPDATE User SET password=password (' [email protected] #123txt ');
> FLUSH privileges;

---------16 Delete unnecessary for
> Delete from user where host <> ' localhost ';
> Update user set host= '% ';
> FLUSH privileges;


--------------------------------------------attached---------------------------------------------
Grant all privileges on * * to [email protected] '% ' identified by ' [email protected] #123txt ";


Vi/etc/my.cnf


[Mysqld]

Innodb_file_per_table=on
Skip-name-resolve
Skip-grant-tables
port=3306


wait_timeout=315360000
interactive_timeout=315360000


Basedir=/usr/local/mysql

datadir=/mysql/data/

Log-error=/mysql/logs/mysql.log

Socket=/mysql/data/socket/mysql.sock

Lower_case_table_names=1
Character-set-server=utf8
open_files_limit=102400

back_log=600

max_connections=10000
max_connect_errors=6000

Sort_buffer_size=2m

max_allowed_packet=64m

thread_cache_size=256
Thread_concurrency=16

Binlog_format = row
Log-bin=mysql-bin

#innodb Config
innodb_buffer_pool_size=4096m
#innodb_file_io_threads =8
Innodb_read_io_threads=8
Innodb_write_io_threads=8
innodb_log_buffer_size=32m
innodb_log_file_size=2048m
Innodb_log_files_in_group=3
Innodb_max_dirty_pages_pct=90

innodb_lock_wait_timeout=300

Explicit_defaults_for_timestamp=true

Sql_mode=no_engine_substitution,strict_trans_tables

[Client]
Socket=/mysql/data/socket/mysql.sock
Default-character-set=utf8
port=3306

[Tutorial]centos Uninstall, install MySQL (source compiled installation method)

Related Article

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.