Hello everyone, today is my first blog post on 51CTO, so as to urge me to develop a good learning habits, but also hope to help you.
OK, to get to the bottom, today I'm introducing the MySQL database installed in the CENTOS6 environment, and I'm using the MySQL package in the CentOS6 image file.
1. Configure the local Yum source.
[Email protected] ~]# cd/etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
Centos-base.repo.bak centos-debuginfo.repo.bak centos-fasttrack.repo.bak Centos-media.repo Centos-vault.repo.bak
Modify the following:
[Email protected] yum.repos.d]# vim Centos-media.repo
baseurl=file:///mnt */mnt as Mount point *
Enabled=1 * Open Status *
2, install MySQL.
[email protected] ~]# Yum List | grep mysql * query for mysql-related packages *
[[email protected] ~]# Yum install-y mysql-server.x86_64 mysql.x86_64 mysql-devel.x86_64 * Install mysql package and develop the package used *
[[Email protected] ~]# service mysqld start * initialize mysql database *
[[Email protected] ~]# service mysqld restart * Restart MySQL service *
[[email protected] ~]# mysqladmin-u root password ' 123456 ' * Configure password for user who manages MySQL *
[Email protected] ~]# mysql-u root-p
Enter Password: * login mysql, enter admin password *
The following appears, indicating a successful login :
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 12
Server version:5.1.73 Source Distribution
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>
related commands: show databases; * View current Databases *
Create Database Ming; * Creating databases named Ming *
3, MySQL configuration file.
[Email protected] ~]# cd/etc/
[[email protected] etc]# ls my.cnf
My.cnf
4. The location of the MySQL database library.
[Email protected] ~]# cd/var/lib/mysql/
[[email protected] mysql]# ls
Ibdata1 ib_logfile0 ib_logfile1 Ming mingming mysql mysql.sock test
5, the MySQL database log file location.
[Email protected] ~]# cd/var/log/
[[email protected] log]# ls
Anaconda.ifcfg.log btmp dmesg maillog-20150802 prelink spooler-20150714
Anaconda.log btmp-20150802 dmesg.old mcelog sa spooler-20150719
Anaconda.program.log consolekit dracut.log Messages Samba spooler-20150730
Anaconda.storage.log cron httpd messages-20150714 Secure spooler-20150802
Anaconda.syslog cron-20150714 lastlog messages-20150719 secure-20150714 SSSD
Anaconda.xlog cron-20150719 maillog messages-20150730 secure-20150719 tallylog
Anaconda.yum.log cron-20150730 maillog-20150714 messages-20150802 secure-20150730 wtmp
Audit cron-20150802 maillog-20150719 mysqld.log secure-20150802 yum.log
Boot.log cups maillog-20150730 ntpstats Spooler
[Email protected] log]# cat Mysqld.log
Version: ' 5.1.73 ' socket: '/var/lib/mysql/mysql.sock ' port: 3306 Source Distribution
*mysql service is TCP with port number 3306*
6, monitor the MySQL service.
[Email protected] ~]# Netstat-tlun
TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
****** This article ends *******
2015-8-3
This article is from "Effort!" Struggle! "Blog, be sure to keep this provenance http://026mingming.blog.51cto.com/8783374/1681434
Installing the MySQL database service under CentOS6