"Combat" Maridb 10.0.15 on CentOS 6.5 installation

Source: Internet
Author: User
Tags administrator password
maridb 10.0.15 on centos 6.5 installation

************************************************** ****************************
1. System part
************************************************** ****************************

-------- 1.desktop can be installed, choose custom

Choose the following two packages, the others are selected according to your needs
base system
legacy unix compatibility (rsh telnet ksh tftp)

Desktops
legacy x window system compatibility (xorg-x11-xdm)


------- 2 Configure yum source

cd /etc/yum.repos.d

mv CentOS-Base.repo CentOS-Base.repo.old


wget http://mirrors.163.com/.help/CentOS6-Base-163.repo


yum makecache


Check for updateable rpm packages
#yum check-update
    
Update all rpm packages
#yum update


--- 3.XDM configuration

--- 3.1 centos 6.5

1). Install XDM

yum install xdm



2) .vi / etc / X11 / xdm / Xaccess


49 * #any host can get a login window



3). Modify the /etc/gdm/custom.conf file.

vi /etc/gdm/custom.conf

[xdmcp]
Enable = true
DisplaysPerHost = 5
Port = 177

[security]
AllowRemoteRoot = true




4). Restart gdm service

/ usr / sbin / gdm -restart





--- 4. Turn off the firewall

chkconfig --level 123456 iptables off

service iptables stop


--- 5. Modify hosts


vi / etc / hosts

192.168.0.128 sphinx.ocp.com sphinx

************************************************** ****************************
2.mysql installation part
************************************************** ****************************


One: uninstall the old version

Use the following command to check if MySQL Server is installed
rpm -qa | grep mysql

If there is, uninstall it with the following command
rpm -e mysql // Ordinary delete mode
rpm -e --nodeps mysql

// Powerful delete mode, if you use the above command to delete, you will be prompted to depend on other files,
Then use this command to force delete it








Two: install MySQL


1. Install the packages needed to compile the code

yum -y install cmake gcc gcc-c ++ autoconf automake zlib * libxml * ncurses ncurses-devel libtool-ltdl-devel * make bison bison-devel libaio


 

2. Create new groups and users for mysql

groupadd mysql
useradd -g mysql mysql




3. Set user's system resource limit

#vi /etc/security/limits.conf

mysql soft nproc 2047
mysql hard nproc 16384
mysql soft nofile 1024
mysql hard nofile 65536





4. Compile and install

tar xvf mariadb-10.0.15.tar.gz

cd mariadb-10.0.15


Compile and install
cmake -DCMAKE_INSTALL_PREFIX = / usr / local / mysql -DMYSQL_DATADIR = / usr / local / mysql / data -DMYSQL_UNIX_ADDR = / usr / local / mysql / mysql.sock -DSYSCONFDIR = / etc -DWITH_INNOBASE_STORAGE_ENGINE = 1 -DWITH_MYENGM_STORAGE_SENGAGE_STORAGE_MYISAM_STORAGE_MYISAM_STORAGE_MYISAM_ 1 -DWITH_SPHINX_STORAGE_ENGINE = 1 -DWITH_XTRADB_STORAGE_ENGINE = 1 -DWITH_READLINE = 1 -DENABLED_LOCAL_INFILE = 1 -DDEFAULT_CHARSET = utf8 -DDEFAULT_COLLATION = utf8_general_ci -DWITH_EXTRA_CHARSETS = all -DENABLED_LOCAL_INFILE = 1 -DWITH_PARTITION_STORAGE_ENGINE = 1 -DEXTRA_CHARSETS = all -DMYSQL_TCP_PORT = 3306 -DWITH_DEBUG = 0



make

make install



The whole process takes about 30 minutes.




Three: Configure MySQL


1. Modify / usr / local / mysql permissions

#mkdir -p / usr / local / mysql


2. New data files, temporary files



mkdir / usr / local / mysql / {innodb_data, data, tmp} -p

mkdir / usr / local / mysql / mysql_logs / {binary_log, innodb_log, query_log, slow_query_log, error_log} -p





3. Modify permissions


chown -R mysql / usr / local / mysql
chgrp -R mysql / usr / local / mysql



4. Modify the parameters



#rm -rf /etc/my.cnf

#vi /usr/local/mysql/my.cnf

## Link file
#ln -s /usr/local/mysql/my.cnf /etc/my.cnf

ll /etc/my.cnf
lrwxrwxrwx. 1 root root 23 Nov 18 17:30 /etc/my.cnf-> /usr/local/mysql/my.cnf

5. Initialize the database


cd / usr / local / mysql / scripts


# ./mysql_install_db --defaults-file = / etc / my.cnf --user = mysql --basedir = / usr / local / mysql --datadir = / usr / local / mysql / data



/ *********************

Note: When starting the MySQL service, it will search for my.cnf in a certain order,

1) ./ etc / my.cnf
2) ./ etc / mysql / my.cnf
3) .SYSCONFDIR / my.cnf
4). $ MYSQL_HOME / my.cnf
5) .defaults-extra-file
6). ~ / .My.cnf
7). ~ / .Mylogin.cnf


********** If you do not specify defaults-file, the following error may occur:
[Warning] InnoDB: Cannot open table mysql / slave_master_info

[Warning] InnoDB: Cannot open table mysql / slave_worker_info

[Warning] InnoDB: Cannot open table mysql / slave_relay_log_info


**************** /


Provide binary files, library files, header files, man manual


echo 'export PATH = / data / apps / mysql / bin: $ PATH'> /etc/profile.d/mysql.sh

echo '/ data / apps / mysql / lib'> /etc/ld.so.conf.d/mysql.conf

ln -sv / usr / local / include / usr / include / mysql


echo 'MANPATH / data / apps / mysql' >> /etc/man.config

man -M / data / apps / mysql / man mysqld --make the man manual effective as the latest





6. Start MySQL

Add a service, copy the service script to the init.d directory, and set the boot

cd / usr / local / mysql /

cp support-files / mysql.server /etc/init.d/mysql

chkconfig mysql on

service mysql start






7. Configure mysql user

After MySQL starts successfully, root has no password by default, and we need to set the root password.


7.1 Modify the / etc / profile file and add it at the end of the file

#vi / etc / profile

PATH = / usr / local / mysql / bin: $ PATH
export PATH


#source / etc / profile

Now, we can enter mysql directly in the terminal to enter, mysql environment

Execute the following command to modify the root password

--7.2 Modify mysql administrator password

---method 1:

mysql -uroot -h127.0.0.1 -p

SET PASSWORD = PASSWORD ('password');

flush privileges;







--7.3 Log in to mysql

# mysql -uroot -ppassword




--7.4 Set mysql user security (not applicable)

select user, host from mysql.user;


delete from mysql.user where (user, host) not in (select 'root', 'localhost');


#Modify the user name and password of root
update mysql.user set user = 'system', password = password ('password') where user = 'root';


truncate table mysql.db;


#New administrator syntax
grant all on *. * to 'root' @ '%' identified by "password" WITH GRANT OPTION;


--7.5 Set the root user can be accessed remotely

--Method 1: Authorization Law

mysql> GRANT ALL PRIVILEGES ON *. * TO 'root' @ '%' IDENTIFIED BY 'password' WITH GRANT OPTION;

flush privileges;

select host, user, passwo
rd from mysql.user;


-Method 2: Modify the table

mysql> update user set host = '%' where user = 'root';

mysql> flush privileges;



---- 7.6 Set Linux script

vi ~ / .bash_profile


#ocpyang set

alias mysql = "mysql -uroot -ppassword --auto-rehash"
alias errorlog = "cat /usr/local/mysql/mysql_logs/error_log/error.log"
alias mycnf = "cd / usr / local / mysql"
export PATH = / usr / local / mysql / scripts: $ PATH


source ~ / .bash_profile


---- 7.7 Modify permissions

chown -R mysql / usr / local / mysql
chgrp -R mysql / usr / local / mysql




---- Common startup errors or warnings

cat /usr/local/mysql/mysql_logs/error_log/error.log

Warning] 'proxies_priv' entry '@% [email protected]' ignored in --skip-name-resolve mode.

Solution:
delete from mysql.proxies_priv where host = 'sphinx.ocp.com';

commit;

flush privileges;







[Practical] Maridb 10.0.15 on centos 6.5 installation
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.