MySQL database from getting started to combat (ii)

Source: Internet
Author: User

MySQL installation (5.6.36) (CentOS6)
(1) Preparation: (Close SELinux, firewall)
(2) Start installation

    • 1, install the dependency package (configured yum source) *
      Yum install-y ncurses-devel Libaio-devel
      Rpm-qa Ncurses-devel Libaio-devel
      Vi/etc/yum.conf
      Keepcache=1 Save the packages used by the network Yum source
      cachedir=/var/cache/yum/$basearch/$releasever saved in this location
      2. Installing CMake
      Yum Install Cmake-y
      Rpm-qa CMake
      3. Set the user
      Useradd-s/sbin/nologin-m MySQL
      ID MySQL
      4. Unzip the installation
      cd/home/oldboy/tools/
      Wget-q http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36.tar.gz
      Ls-l mysql-5.6.36.tar.gz
      Try to download the official
      [Email protected] data]# md5sum mysql-5.6.36.tar.gz
      A36A241164C78286993CBE1079626CDD mysql-5.6.36.tar.gz
      [Email protected] data]#
      Tar XF mysql-5.6.36.tar.gz
      CD mysql-5.6.36

CMake. -dcmake_install_prefix=/application/mysql-5.6.36 \
-dmysql_datadir=/application/mysql-5.6.36/data \
-dmysql_unix_addr=/application/mysql-5.6.36/tmp/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_extra_charsets=all \
-dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwithout_example_storage_engine=1 \
-dwith_zlib=bundled \
-dwith_ssl=bundled \
-denabled_local_infile=1 \
-dwith_embedded_server=1 \
-denable_downloads=1 \
-dwith_debug=0

Make && make install
Ln-s/application/mysql-5.6.36//application/mysql
5. Initializing and configuring the database
CP SUPPORT-FILES/MY*.CNF/ETC/MY.CNF
The following two steps must be done, otherwise initialization error
Mkdir-p/application/mysql-5.6.36/tmp
Chown-r mysql.mysql/application/mysql-5.6.36/tmp

/application/mysql/scripts/mysql_install_db--basedir=/application/mysql/--datadir=/application/mysql/data-- User=mysql

Chown-r mysql.mysql/application/mysql/
CP Support-files/mysql.server/etc/init.d/mysqld
chmod 700/etc/init.d/mysqld

/etc/init.d/mysqld start
Chkconfig mysqld on
Chkconfig--list mysqld
Netstat-lntup|grep 3306

Echo ' path=/application/mysql/bin/: $PATH ' >>/etc/profile
Source/etc/profile
Mysql

Set Password:
mysqladmin-u root password ' 123456 '
Mysql-uroot-poldboy123
Clean up users and useless databases (basic optimizations)
Select User,host from Mysql.user;
Drop user ' @ ' db02 ';
Drop user ' @ ' localhost ';
Drop user ' root ' @ ' db02 ';
Drop user ' root ' @ ':: 1 ';
Select User,host from Mysql.user;
drop database test;
show databases;

Problems:
Fault: error! The server quit without updating PID file
1. Permissions. Chown-r Mysql.mysql
2.killall mysqld
3. Reinitialize the data.
4. Running for 1 years, a problem (illegal (power off) shutdown or illegal shut down the database, such as kill-9).

MySQL database from getting started to combat (ii)

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.