Home  >  Article  >  Database  >  suse mysql anso mysql

suse mysql anso mysql

王林
王林Original
2023-05-18 12:55:071287browse

How to install MySQL on SUSE system

MySQL is an open source relational database management system that is suitable for many different types of applications. This article will introduce how to install MySQL in a SUSE system.

Step One: Install the Necessary Software Packages

Before installing MySQL, you must ensure that some necessary software packages are installed on your SUSE system. These packages include:

  • gcc
  • gcc-c
  • make
  • bison
  • glibc-devel
  • libgcc
  • ncurses-devel

You can use the following command to install these packages:

zypper install gcc gcc-c++ make bison glibc-devel libgcc ncurses-devel

Step 2: Download the MySQL installation file

Download the MySQL installation program. You can download the latest version of MySQL from the official website http://dev.mysql.com/downloads/mysql/.

wget http://dev.mysql.com/get/mysql-community-release-suse12-5.noarch.rpm

Step Three: Install MySQL

To install MySQL, use the following command:

rpm -ivh mysql-community-release-suse12-5.noarch.rpm

This will add the MySQL repository to your system and enable you to use The zypper command installs MySQL.

zypper install mysql-server

Step 4: Start the MySQL service

Use the following command to start the MySQL service:

systemctl start mysql

To start the MySQL service when the system starts, use the following command:

systemctl enable mysql

Step 5: Log in to MySQL

You can now log in to MySQL using the following command:

mysql -u root -p

This will prompt you to enter your MySQL password. If you are logging into MySQL for the first time, you can change your password using the following command:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

Replace "yourpassword" with your own password.

Step 6: Create new users and databases

Now, you can create your own database and users. Create a new user and database using the following command:

CREATE DATABASE dbname;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

In the above command, replace "dbname" with the name of the database you want to create, "username" with the new username you want to create, "password" Replace with the user's password.

This is the process of installing MySQL in the SUSE system. Once installed, you can start using MySQL as your database in your SUSE system.

The above is the detailed content of suse mysql anso mysql. 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:Delete mysql foreign keyNext article:Delete mysql foreign key