How to install mysql under centos
How to install mysql under centos: 1. Download and install the official MySQL Yum Repository; 2. Install the MySQL server; 3. Log in to the database; 4. Modify the MySQL default password; 5. Enable remote access to mysql. Can.
The operating environment of this article: Windows 7 system, Mysql version 5.7.14, Dell G3 computer.
How to install mysql under centos?
CentOS7 installation MySQL (full version)
MariaDB is installed by default in CentOS. This is a branch of MySQL, but for needs, it still needs to be installed in the system. Install MySQL in and overwrite MariaDB directly after the installation is complete.
1 Download and install MySQL official Yum Repository, Mysql version 5.7.14
[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
[root@localhost ~]# yum -y install mysql-community-server
[root@localhost ~]# systemctl start mysqld.service
[root@localhost ~]# systemctl status mysqld.service
[root@localhost ~]# grep "password" /var/log/mysqld.log
[root@localhost ~]# mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
SHOW VARIABLES LIKE 'validate_password%';
set global validate_password_policy=LOW;
set global validate_password_length=6;
##3 Open Mysql remote access
grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option;
Note: password--is the password you set for your mysql remote login.
Then enter the following two lines of commandsmysql> flush privileges;
4 、开启防火墙端口,CentOS为firewalld添加开放端口3306,具体是什么参考如下:
https://i-beta.cnblogs.com/posts?cateId=1653053
5 、更改mysql的语言
首先重新登录mysql,然后输入status:
可以看到,红色方框处不是utf-8,修改为utf8即可。
因此我们先退出mysql,然后再到/etc目录下的my.cnf文件下修改一下文件内容
cd /etc
进入文件后,新增四行代码:
保存更改后的my.cnf文件后,重启下mysql,然后输入status再次查看,你就会发现变化啦
到此CentOS7安装Mysql5.7完毕。
set global validate_password_policy=LOW;
【相关推荐:mysql视频教程】
The above is the detailed content of How to install mysql under centos. For more information, please follow other related articles on the PHP Chinese website!

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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

RedHatendedsupportforCentOStoshifttowardsacommerciallyfocusedmodelwithCentOSStream.1)CentOStransitionedtoCentOSStreamforRHELdevelopment.2)ThisencourageduserstomovetoRHEL.3)AlternativeslikeAlmaLinux,RockyLinux,andOracleLinuxemergedasreplacements.

SQL is a standard language for managing relational databases, while MySQL is a database management system that uses SQL. SQL defines ways to interact with a database, including CRUD operations, while MySQL implements the SQL standard and provides additional features such as stored procedures and triggers.

MySQL and phpMyAdmin can be effectively managed through the following steps: 1. Create and delete database: Just click in phpMyAdmin to complete. 2. Manage tables: You can create tables, modify structures, and add indexes. 3. Data operation: Supports inserting, updating, deleting data and executing SQL queries. 4. Import and export data: Supports SQL, CSV, XML and other formats. 5. Optimization and monitoring: Use the OPTIMIZETABLE command to optimize tables and use query analyzers and monitoring tools to solve performance problems.

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.
