GNU/Linux >> Linux Esercitazione >  >> Linux

Come installare MySQL su CentOS 7.x?

MySQL è uno dei più diffusi sistemi di gestione di database. Per ora, MySQL non è più all'interno del repository Centos e MariaDB è ora il database predefinito offerto dai repository Centos.

Riteniamo che tu abbia effettuato l'accesso con l'utente root per eseguire questi passaggi. Fare riferimento ai seguenti passaggi per installare MySQL 5.7 su Centos 7.1

  1. Prima di tutto, aggiorniamo i centos con il comando yum update.

    Yum update
  2. Installa wget per scaricare i file da Internet.

    yum  install wget 
  3. Procediamo con l'installazione di MySQL . Scarica e aggiungi il repository in un primo momento.

    wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
    rpm -ivh mysql80-community-release-el7-3.noarch.rpm
  4. Esegui il comando seguente per installare MySQL 5.7 sul tuo VPS.

    yum -y install mysql-community-server  --disablerepo=mysql80-community --enablerepo=mysql57-community
  5. Avvia e controlla lo stato del servizio MySQL.

    systemctl start mysqld
    systemctl enable mysqld
    systemctl status mysqld
  6. Ottieni una password temporanea per l'utente root: 

    less /var/log/mysqld.log | grep pass
    A temporary password is generated for [email protected]: o!5y,JGALQa
  7. Esegui uno strumento di installazione sicura per reimpostare la password.

    $ sudo mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root: The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
  1. Collega il server mysql: 

    mysql -u root -p

Linux
  1. Come installare MySQL su Ubuntu 20.04

  2. Come installare MySQL 8.0 su Fedora 35 / Fedora 34

  3. Come installare Elgg su CentOS 6

  4. Come installare MySQL su Ubuntu 22.04

  5. Come installare MySQL 5.6 su CentOS 6.x

Come installare Joomla su CentOS 6

Come installare Gibbon su CentOS 6

Come installare Moodle su CentOS 6

Come installare Zabbix su CentOS 6

Come installare osTicket su CentOS 6

Come installare MySQL 8.0 su Ubuntu 18.04