Mysql Database Installation application
1:MySQL is a multi-user, multi-threaded service.
Advantages:
Performance
High reliability and ease of use
Default Usage TCP 3306 port matching file is /etc/my.cnf
2:MySQL Compilation installation process:
use rpm-q mysql-server mysql to check if mysql packets are installed , or if there is a suggestion to uninstall, the subsequent conflicts will occur
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8F/86/wKiom1jjokTTN7uJAAAjvcofjZo354.png-wh_500x0-wm_ 3-wmp_4-s_3222477367.png "title=" image 1.png "alt=" Wkiom1jjokttn7ujaaajvcofjzo354.png-wh_50 "/>
Install The Ncurses-devel package to resolve dependencies
rpm-ivh/media/packages/ncurses-devel-5.7-3.20090208.e16.x68.rpm Bag
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/86/wKiom1jjonGgYi2uAAAfPAgm6F0698.png-wh_500x0-wm_ 3-wmp_4-s_385237722.png "title=" image 2.png "alt=" Wkiom1jjonggyi2uaaafpagm6f0698.png-wh_50 "/>
3:MySQL5.5 requires cmake compilation installation, so install cmake Package First
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8F/84/wKioL1jjopLDu7YeAAAKcPXO3ds788.png-wh_500x0-wm_ 3-wmp_4-s_3167154778.png "title=" image 3.png "alt=" Wkiol1jjopldu7yeaaakcpxo3ds788.png-wh_50 "/>
4: In order to strengthen the database permissions control, create a dedicated user, this user can not directly log on to the system
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8F/86/wKiom1jjorGQ_VvYAAADMEL2ywc355.png-wh_500x0-wm_ 3-wmp_4-s_154440442.png "title=" image 4.png "alt=" wkiom1jjorgq_vvyaaadmel2ywc355.png-wh_50 "/>650) this.width=650;" Src= "Https://s4.51cto.com/wyfs02/M02/8F/86/wKiom1jjos-xdtlTAAAEn1oIcNE615.png-wh_500x0-wm_3-wmp_4-s_ 1759310124.png "title=" image 5.png "alt=" wkiom1jjos-xdtltaaaen1oicne615.png-wh_50 "/>
5: Unzip the MySQl Package
-dcmake_install_prefix: is a fixed installation directory path
-dsysconfdir: Specifying initialization parameters
-ddefault_charset: Specifies the default character set encoding UTF8
-ddefault_collation: Specifies that a character set validation rule is used by default
-dwith_extra_charsets: Specifies additional other character set encodings
Because the contents of the database are large, the contents of the database need to be configured.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/8F/84/wKioL1jjouqCs1vRAAAeXMDJhTY558.png-wh_500x0-wm_ 3-wmp_4-s_1209899213.png "title=" image 6.png "alt=" Wkiol1jjouqcs1vraaaexmdjhty558.png-wh_50 "/>
6: Other adjustments after installation
(1) To set permissions on a database directory
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8F/84/wKioL1jjowWBCkf9AAAFhiiNAY4371.png-wh_500x0-wm_ 3-wmp_4-s_1936376579.png "title=" image 7.png "alt=" Wkiol1jjowwbckf9aaafhiinay4371.png-wh_50 "/>
(2) Set up configuration file, generally choose my-medium.cnf Medium Enterprise database
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8F/84/wKioL1jjo37jS6RZAAAOK3zTD8M675.png-wh_500x0-wm_ 3-wmp_4-s_428623485.png "title=" image 8.png "alt=" Wkiol1jjo37js6rzaaaok3ztd8m675.png-wh_50 "/>
(3) Initialize database: In order to be able to use the database should execute initialization script as MySQL user mysql_install_db Specify data storage directory
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8F/84/wKioL1jjo53ia3N3AAAG_gEVr_M435.png-wh_500x0-wm_ 3-wmp_4-s_200523423.png "title=" image 9.png "alt=" Wkiol1jjo53ia3n3aaag_gevr_m435.png-wh_50 "/>
(4) setting environment variables, which are global variables
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/8F/84/wKioL1jjo8nQHN86AAAU-NJ8xBE687.png-wh_500x0-wm_ 3-wmp_4-s_593330011.png "title=" image 10.png "alt=" Wkiol1jjo8nqhn86aaau-nj8xbe687.png-wh_50 "/>
7: Add system Services, which can then be set using the service:
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/84/wKioL1jjo_LxUoWMAAAZ4ZArrQQ978.png-wh_500x0-wm_ 3-wmp_4-s_2340918786.png "title=" image 11.png "alt=" Wkiol1jjo_lxuowmaaaz4zarrqq978.png-wh_50 "/>
Verify the effect:
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8F/84/wKioL1jjpB_DmPV1AAAUCb4bgYs146.png-wh_500x0-wm_ 3-wmp_4-s_1830116553.png "title=" image 12.png "alt=" Wkiol1jjpb_dmpv1aaaucb4bgys146.png-wh_50 "/>
8: Access to the database, the database is a typical c/S architecture application.
Log in to the database:
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/8F/86/wKiom1jjpDfDBGgEAAAjUjpohF4670.png-wh_500x0-wm_ 3-wmp_4-s_2877344557.png "title=" image 13.png "alt=" Wkiom1jjpdfdbggeaaajujpohf4670.png-wh_50 "/>
9: Execute the MySQL Action statement to view the database's libraries and tables
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/86/wKiom1jjpE_jbvm6AAALS-cbF-4747.png-wh_500x0-wm_ 3-wmp_4-s_3132401080.png "title=" image 14.png "alt=" Wkiom1jjpe_jbvm6aaals-cbf-4747.png-wh_50 "/>
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/84/wKioL1jjpGyzC37MAAALtZYGxuA467.png-wh_500x0-wm_ 3-wmp_4-s_3035213703.png "title=" image 15.png "alt=" wkiol1jjpgyzc37maaaltzygxua467.png-wh_50 "/>
Ten: View the structure of a table
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/8F/86/wKiom1jjpKGQGyrXAAAJoQDcrA8415.png-wh_500x0-wm_ 3-wmp_4-s_1689887669.png "title=" image 16.png "alt=" Wkiom1jjpkgqgyrxaaajoqdcra8415.png-wh_50 "/>
One: Create tables and libraries using the creare command
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/84/wKioL1jjpMTzFvwNAAAYqhKAN7s831.png-wh_500x0-wm_ 3-wmp_4-s_3836809638.png "title=" image 17.png "alt=" Wkiol1jjpmtzfvwnaaayqhkan7s831.png-wh_50 "/>
: Delete the library and table commands using the drop command:
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/8F/84/wKioL1jjpOOiBwWsAAAWAbi9YVU663.png-wh_500x0-wm_ 3-wmp_4-s_2145957205.png "title=" image 18.png "alt=" Wkiol1jjpooibwwsaaawabi9yvu663.png-wh_50 "/>
: Insert data record in table, here we use the users table in the TTY Library
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/8F/86/wKiom1jjpPuwZ4SBAAATCtD3iIo919.png-wh_500x0-wm_ 3-wmp_4-s_1636216639.png "title=" image 19.png "alt=" Wkiom1jjppuwz4sbaaatctd3iio919.png-wh_50 "/>
query data records use the select command to find: Find information for Zhangsan users:
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8F/86/wKiom1jjpRTilHTqAAAPFJiFFWU212.png-wh_500x0-wm_ 3-wmp_4-s_3280702276.png "title=" image 20.png "alt=" Wkiom1jjprtilhtqaaapfjiffwu212.png-wh_50 "/>
: Maintaining MySQL Database
User Authorization Required: Select,insert,update,all Here we will use all permissions to test:
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/84/wKioL1jjpTbDnhMjAAAQp4GtyHs661.png-wh_500x0-wm_ 3-wmp_4-s_182340581.png "title=" image 21.png "alt=" Wkiol1jjptbdnhmjaaaqp4gtyhs661.png-wh_50 "/>
16; Backup and recovery of database : the first thing to do is to export the contents of the database before importing the database for recovery:
Use the command mysqldump to export a database
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/86/wKiom1jjpU6BvkH8AAAq8HV4vz4732.png-wh_500x0-wm_ 3-wmp_4-s_3906854045.png "title=" image 22.png "alt=" Wkiom1jjpu6bvkh8aaaq8hv4vz4732.png-wh_50 "/>
then restore the database MySQL library: First delete the MySQL library and then restore:
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/84/wKioL1jjpWzBRjC8AAAP1wCVRss891.png-wh_500x0-wm_ 3-wmp_4-s_2784242579.png "title=" image 23.png "alt=" Wkiol1jjpwzbrjc8aaap1wcvrss891.png-wh_50 "/>
Start Recovery: Verify effect
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8F/86/wKiom1jjpYWQtFBNAAAC6sizgHw478.png-wh_500x0-wm_ 3-wmp_4-s_3410032126.png "title=" image 24.png "alt=" Wkiom1jjpywqtfbnaaac6sizghw478.png-wh_50 "/>
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8F/84/wKioL1jjpZvgXS6dAAAQQOl74pc415.png-wh_500x0-wm_ 3-wmp_4-s_1032487056.png "title=" image 25.png "alt=" Wkiol1jjpzvgxs6daaaqqol74pc415.png-wh_50 "/>
: Bit MySQL database user root set a password in two ways:
(1) use mysqladmin-u root-p password ' Password '
(2) Modify using the update command
Update Mysql.user Set Password=password (' password ') WHERE user= ' root ';
then flush the authorization flush privileges;
We use the first method of setting the password:
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8F/84/wKioL1jjpb_wGJ2YAAAF3vhADOw739.png-wh_500x0-wm_ 3-wmp_4-s_1180249823.png "title=" image 26.png "alt=" Wkiol1jjpb_wgj2yaaaf3vhadow739.png-wh_50 "/>
The second way to set the password:
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8F/86/wKiom1jjpdrQEqkAAAAaPTQYQqU171.png-wh_500x0-wm_ 3-wmp_4-s_6662582.png "title=" image 27.png "alt=" Wkiom1jjpdrqeqkaaaaaptqyqqu171.png-wh_50 "/>
This article is from the "Apache" blog, make sure to keep this source http://xiaorenwutest.blog.51cto.com/12754924/1912931
MySQL platform installation and application