Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure MySQL files under Ubuntu

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install and configure MySQL under Ubuntu". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to install and configure MySQL files under Ubuntu".

The characteristics of Ubuntu MySQL system, combined with application examples, can be used not only as Ubuntu MySQL learning for computer majors in colleges and universities, but also as learning for Ubuntu MySQL system users who are open source lovers of Ubuntu MySQL systems. Ubuntu contains a very good translation and easy-to-use architecture, which will be continuously provided by the free software community and will make Ubuntu as easy for most people as possible.

Install Ubuntu MySQL

Sudo apt-get install mysql-server mysql-admin mysql-navigator mysql-query-browser

This should be very simple, and I don't think there is much problem with installation, so I won't say much about it. Let's talk about configuration.

Configure Ubuntu MySQL

Note that local access is only allowed by default in Ubuntu MySQL, so you need to change the / etc/mysql/my.cnf configuration file if you want other machines to be able to access it! Let's take it one step at a time:

After the default Ubuntu MySQL installation, the root user does not have a password, so first enter with the root user: $mysql-u root

The reason for using-u root here is that I am now a regular user (firehare). If I don't add-u root, mysql will think that firehare is logging in. Note that I did not enter root mode here because it is not necessary. In general, it is not necessary to enter root mode when operating on a database in mysql, which is only possible when set up.

After entering Ubuntu MySQL, the most important thing is to set the root user password in Mysql, otherwise, the Ubuntu MySQL service has no security to speak of.

Mysql > GRANT ALL PRIVILEGES ON *. * TO root@localhost IDENTIFIED BY "123456"

Note that I use 123456 as the password for root users here, but the password is not secure. Please use a mixed password of uppercase and lowercase letters and numbers with no less than 8 characters.

In that case, set the root password in Ubuntu MySQL, and then use the root user to build the database you need. Let me take xoops as an example:

Mysql > CREATE DATABASE xoops

Mysql > GRANT ALL PRIVILEGES ON xoops.* TO xoops_root@localhost IDENTIFIED BY "654321"

This creates a user of xoops_roots that has full permissions on the database xoops. In the future, xoops_root is used to manage the xoops database, and there is no need to use the root user, and the permissions of that user are only limited to the xoops database.

If you want to access or control remotely, you need to do two things:

One is:

Mysql > GRANT ALL PRIVILEGES ON xoops.* TO xoops_root@ "" IDENTIFIED BY "654321"

Allow xoops_root users to log in to MySQL from any machine.

Second:

$sudo gedit / etc/mysql/my.cnf

In the older version of Ubuntu MySQL

> skip-networking = > # skip-networking

In the new version of Ubuntu MySQL

> bind-address=127.0.0.1 = > bind-address= the IP of your machine

This allows other machines to access MySQL.

At this point, I believe you have a deeper understanding of "how to install and configure MySQL under Ubuntu". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report