Home >Database >Mysql Tutorial >how install mysql with linux

how install mysql with linux

Jennifer Aniston
Jennifer AnistonOriginal
2024-12-30 15:09:12127browse

How to install MySQL on Linux using the command line?

  • To install MySQL on Linux using the command line, start by updating the package manager cache with the following command:

    <code>$ sudo apt update</code>
  • Next, install the MySQL server package with the following command:

    <code>$ sudo apt install mysql-server</code>
  • Once the installation is complete, you can verify that MySQL is running by checking the status of the service with the following command:

    <code>$ sudo systemctl status mysql</code>

How to configure MySQL after installation on Linux?

  • Once MySQL is installed, you can configure it by editing the configuration file located at /etc/mysql/mysql.conf.d/mysqld.cnf.
  • Some common settings that you may want to adjust include:

    • The port that MySQL listens on (default: 3306)
    • The maximum number of connections (default: 151)
    • The maximum packet size (default: 16MB)
  • Once you have made your changes, you can save the file and restart MySQL with the following command:

    <code>$ sudo systemctl restart mysql</code>

What are the system requirements for installing MySQL on Linux?

  • The system requirements for installing MySQL on Linux are as follows:

    • A processor that supports the x86-64 architecture
    • A minimum of 512MB of RAM
    • A minimum of 1GB of free disk space
    • A stable internet connection

The above is the detailed content of how install mysql with linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:how learn mysqlNext article:how learn mysql