Home > Database > Mysql Tutorial > suse mysql anso mysql

suse mysql anso mysql

王林
Release: 2023-05-18 12:55:07
Original
1339 people have browsed it

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
Copy after login

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
Copy after login

Step Three: Install MySQL

To install MySQL, use the following command:

rpm -ivh mysql-community-release-suse12-5.noarch.rpm
Copy after login

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

zypper install mysql-server
Copy after login

Step 4: Start the MySQL service

Use the following command to start the MySQL service:

systemctl start mysql
Copy after login

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

systemctl enable mysql
Copy after login

Step 5: Log in to MySQL

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

mysql -u root -p
Copy after login

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');
Copy after login

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;
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template