Install mysql/mariadb under openSUSE

Source: Internet
Author: User
Tags anonymous mysql client

MySQL is a popular cross-platform database management system, often and PHP, Apache/nginx form a Web services platform. The MySQL company was first acquired by Sun, and Sun was acquired by Oracle, giving the open source community a hard hit. Because Oracle is a database startup, it is impossible to benefit from this open source competitor, and MySQL has more and more closed source sounds. MySQL author Michael Widenius himself founded the new company Monty Program AB, a new MARIADB open source database based on MySQL. MARIADB brings better database management features, better free and open source protection. So when the openSUSE 12.3 release, MySQL was discarded and the new mariadb was integrated. MARIADB use the same way as MySQL (two databases contain a bunch of filenames that are the same, so do not fashion), but the performance is better. So here only the MARIADB installation configuration is introduced.

MARIADB server-side package called MARIADB, the client is called Mariadb-client, there is a MARIADB management tool set called Mariadb-tools. openSUSE defaults on the top two, and it's recommended to pack up to three of them.
zypper in Mariadb-tools mariadb mariadb-client


After installation, you can view the following note:

Message from Package MARIADB:

You just installed MySQL server for the first time.

You can start it using:
Rcmysql start

During first start empty database is created for your automatically.

REMEMBER to SET A PASSWORD for the MariaDB root USER!
To does so, start the server, then issue the following commands:

'/usr/bin/mysqladmin '-u root password ' New-password '
'/usr/bin/mysqladmin '-u root-h misibook password ' new-password '

Alternatively you can run:
'/usr/bin/mysql_secure_installation '

Which would also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.




The initial configuration is required after the file is loaded. The following installation configuration is performed on the root command line:

(1) Start MARIADB database service
Systemctl Enable Mysql.servicesystemctl start Mysql.service
(2) Set the database root password:
mysqladmin-u root Password database root password
(3) Enter the database background:
mysql-u root-p-h localhost
Enter the database root password and enter the database console, you can execute the SQL command:

(4) Set a new normal user name
After logging in to the database management console, perform the following:
CREATE user ' normal username ' @ '% ' identified by ' normal user password ';GRANT All privileges on * * to ' normal user name ' @ '% ';
Replace the above ordinary user name, ordinary user password to your favorite account and password, such as
CREATE USER ' susedb ' @ '% ' identified by ' opensuse123 ';
GRANT all privileges on * * to ' susedb ' @ '% ';
Try to use the database with the new login as Susedb account.

(5) Running the security configuration
Execute command:
mysql_secure_installation
At the command line, enter as prompted:
Display enter current password for root (enter for none):
Enter the database root password

Show change the root password? [y/n]: N
(existing password, no need to reset)

The following select all Y to remove the database unsafe default settings:
Remove anonymous users? [y/n] Y
Disallow Root login remotely? [y/n] Y
Remove test database and access to it? [y/n] Y
Reload privilege tables now? [y/n] Y

Some of these default unsafe settings are removed. Because the database root cannot be telnet, a new normal account such as susedb is required.

(6) Open firewall port
If you need to telnet to the database, you need to open the default firewall port of openSUSE. If you are only managing the database natively, you do not need to open firewall ports.

Open the "Security and user----" firewall in yast----.
In the Settings window, select "Allowed Services" on the left, and the right area with the default "external zone",
To allow the service select "MySQL Server", click "Add", then click "Next" to complete the configuration.

The remote login database can be executed:
mysql-u susedb-p-H database server IP
The MySQL client under Windows can also log on to the database server on openSUSE using the user name, password, and database server IP.

Install mysql/mariadb under openSUSE

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.