linuxDownloadmysqlUnzipInstallationProcess (centos redhat has been used for N rounds in the production environment)
1.Upload mysql-5.5.29-linux2.6-x86_64.tar.gz file to the opt directory
2. Enter the opt directory to decompress the file#tar -zxvf mysql-5.5.29-linux2.6-x86_64.tar.gz
3. Create mysql user group #groupadd mysql
4. Create a mysql user and join the mysql user group #useradd mysql -g mysql -p 1234567890 -s /sbin/nologin -M
5. Create a soft link #ln -s mysql-5.5.29-linux2.6-x86_64 mysql
6. (Explanation, the following /opt/mysql/ path must be consistent, if it is /opt/mysql, then keep this consistent)
#cd mysql #chown -R mysql . #chgrp -R mysql . #scripts/mysql_install_db --user=mysql --datadir=/opt/mysql/data/ #chown -R root . #chown -R mysql data #cp support-files/my-medium.cnf /etc/my.cnf (128M内存) 或者cp support-files/my-large.cnf /etc/my.cnf(512M内存) 或者cp support-files/my-huge.cnf /etc/my.cnf (1-2G内存) 或者cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf(4G内存)
Modify the port and other configurations in the my.cnf file
#vi /etc/my.cnf
(1). Change the 3306 port in two places to 13316
( 2), Maximum number of connections and innodb_file_per_table settings. Turn on
At the end of
# The MySQL server
[mysqld]
, add
max_connections=3100 innodb_file_per_table=1
#bin/mysqld_safe --user=mysql & Wait a few minutes before executing (press Enter)
Copy file#cp support-files/mysql.server /etc/init.d/mysql
Then modify /etc/ init.d/mysql file
basedir=/opt/mysql datadir=/opt/mysql/data
Look down, these are changed to this (associated with the mysql path of the decompression installation):
basedir=/opt/mysql bindir=/opt/mysql/bin datadir=/opt/mysql/data sbindir=/opt/mysql/bin libexecdir=/opt/mysql/bin
Automatic startup# chkconfig --add mysql
#chkconfig mysql on
Stop#service mysql stop If the Punrecognized service error is reported: chmod 755 /etc/rc.d/init.d/mysql
Start#service mysql start
#cd ../
Initialize the password of the administrator root#/opt/mysql/bin/mysqladmin -u root password '1234567890'
Enable the root account to be used for local and remote connections#/opt/mysql/ bin/mysql -u root -p
Enter the initial good password 1234567890
mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "1234567890"; mysql>flush privileges;
Create other accounts
mysql>GRANT ALL PRIVILEGES ON *.* TO abcd@"%" IDENTIFIED BY "abcd#123456"; mysql>flush privileges; mysql>quit;
View mysql process
#ps -ef |grep mysql
Come on, give yourself a like, it’s completed, please keep working hard.
【Related recommendations】
1. Free mysql online video tutorial
2. MySQL latest manual tutorial
3. Chuanzhi Podcast Liu Daocheng MySql series video tutorials
The above is the detailed content of Teach you an example of how to quickly install mysql. For more information, please follow other related articles on the PHP Chinese website!

MySQLdiffersfromotherSQLdialectsinsyntaxforLIMIT,auto-increment,stringcomparison,subqueries,andperformanceanalysis.1)MySQLusesLIMIT,whileSQLServerusesTOPandOracleusesROWNUM.2)MySQL'sAUTO_INCREMENTcontrastswithPostgreSQL'sSERIALandOracle'ssequenceandt

MySQL partitioning improves performance and simplifies maintenance. 1) Divide large tables into small pieces by specific criteria (such as date ranges), 2) physically divide data into independent files, 3) MySQL can focus on related partitions when querying, 4) Query optimizer can skip unrelated partitions, 5) Choosing the right partition strategy and maintaining it regularly is key.

How to grant and revoke permissions in MySQL? 1. Use the GRANT statement to grant permissions, such as GRANTALLPRIVILEGESONdatabase_name.TO'username'@'host'; 2. Use the REVOKE statement to revoke permissions, such as REVOKEALLPRIVILEGESONdatabase_name.FROM'username'@'host' to ensure timely communication of permission changes.

InnoDB is suitable for applications that require transaction support and high concurrency, while MyISAM is suitable for applications that require more reads and less writes. 1.InnoDB supports transaction and bank-level locks, suitable for e-commerce and banking systems. 2.MyISAM provides fast read and indexing, suitable for blogging and content management systems.

There are four main JOIN types in MySQL: INNERJOIN, LEFTJOIN, RIGHTJOIN and FULLOUTERJOIN. 1.INNERJOIN returns all rows in the two tables that meet the JOIN conditions. 2.LEFTJOIN returns all rows in the left table, even if there are no matching rows in the right table. 3. RIGHTJOIN is contrary to LEFTJOIN and returns all rows in the right table. 4.FULLOUTERJOIN returns all rows in the two tables that meet or do not meet JOIN conditions.

MySQLoffersvariousstorageengines,eachsuitedfordifferentusecases:1)InnoDBisidealforapplicationsneedingACIDcomplianceandhighconcurrency,supportingtransactionsandforeignkeys.2)MyISAMisbestforread-heavyworkloads,lackingtransactionsupport.3)Memoryengineis

Common security vulnerabilities in MySQL include SQL injection, weak passwords, improper permission configuration, and unupdated software. 1. SQL injection can be prevented by using preprocessing statements. 2. Weak passwords can be avoided by forcibly using strong password strategies. 3. Improper permission configuration can be resolved through regular review and adjustment of user permissions. 4. Unupdated software can be patched by regularly checking and updating the MySQL version.

Identifying slow queries in MySQL can be achieved by enabling slow query logs and setting thresholds. 1. Enable slow query logs and set thresholds. 2. View and analyze slow query log files, and use tools such as mysqldumpslow or pt-query-digest for in-depth analysis. 3. Optimizing slow queries can be achieved through index optimization, query rewriting and avoiding the use of SELECT*.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
