Blogger is a linux beginner, I decided to record the learning process bit by bit, as a growth record or, as people refer to later learn whether, in short, a blog is out there, we have what they want, just do not let him lonely just fine.
First, the persistent data is a necessary program modules, to coincide with bloggers projects also need to be deployed on centos operating systems, so we started to install the mysql database. Perhaps you feel that the content is relatively simple, but it does not matter, will is Called simple; those who are not that difficult. Bloggers just use the simplest description, to meet the "who does not" love of learning.
Are two main ways, or by downloading the installation package, and then install; is through yum command. Bloggers think through relatively simple yum command, it decided to adopt this method.
1. Install mysql
yum -y install mysql-server
2. Check all mysql directory
rpm –ql mysql
3. Start mysql
/etc/rc.d/init.d/mysqld start or service mysqld start
If unsuccessful, according to the specific message, different treatment, under normal circumstances, there will be:
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER!
It is possible for the first user root password.
Set a password for the user root 3.1: / usr / bin / mysqladmin -u root password '123456' ( note here usr / bin / mysqladmin is varies, depending on the installation directory under 1 See step )
After 3.2 After setting, re-run the service mysqld start, it appears:
Starting mysqld: [OK]
Show starts successfully.4. Set the mysql service boot
chkconfig mysqld on
5. See if successful
chkconfig -list mysqld (2-5 if on, indicates that the start to work)
6. landing mysql
mysql -u root -p after the prompts to enter your password.
7. Check whether the successful landing
It can run mysql related instructions to verify your own results. For example: show databases; and so on.
8. unauthorized remote access to the database
grant all privileges on *.* to ‘root’@‘%’ identified by ‘123456’ with grant option;
flush privileges;
'Root': indicate unauthorized remote access user name
'%': That unauthorized access to a remote computer ip,% means that all
'123456': that unauthorized remote access database password
9.Question & Answer
At this point if not remote access, you can view firewall related
9.1 View command: /etc/init.d/iptables status
9.2 turn off the firewall command: /etc/init.d/iptables stop
10. summary
Recalling the above, it introduces install mysql database; start the database; set the database user name, password; set the mysql boot from the start; authorized remote access and so on. Finally, the issue of bloggers appear during the installation process. If you show up other questions, please share.
Reproduced in: https: //www.cnblogs.com/struggletofly/p/3912165.html