In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the steps of installing mysql database in ubuntu 13.04. interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn the "ubuntu 13.04 installation of mysql database steps" it!
Ubuntu is a popular Linux operating system, based on the Debian distribution and the GNOME desktop environment. Compared with other Linux distributions, Ubuntu is very easy to use and has good compatibility with Windows. It is very suitable for the migration of Windows users. A large number of commonly used software is pre-installed, and the Chinese version has full functions. It supports Pinyin input method and is pre-installed with most common software such as firefox, Open Office, multimedia playback, image processing and so on. Generally, drivers of network cards, sound cards and other devices will be installed automatically.
Install MySQL
You can use the Ubuntu Software Center or apt command to install MySQL on Ubuntu, both of which are very convenient.
1. Use Ubuntu Software Center: open Ubuntu Software Center, query mysql in the search box in the upper right corner, select MySQL Server, and click install.
two。 Use apt: open the terminal and execute "sudo apt-get install mysql-server".
Initial configuration of MySQL
After MySQL is installed, you can log in directly using your root account, which does not have a password by default. Note that the root role here refers to the root role of your Ubuntu. If your current system account is not root, you do not have to switch to the system root account. You can use the "- u" parameter to specify the login account when logging in to MySQL. Such as:
$mysql-u rootmysql > show databases;+-+ | Database | +-+ | information_schema | | mysql | | performance_schema | | test | +-+ 4 rows in set (0.00 sec) mysql > select Host, User from user +-+-+ | Host | User | +-+-+ | 127.0.0.1 | root | |:: 1 | root | | iUbuntu | | iUbuntu | | root | | localhost | localhost | debian-sys-maint | | localhost | root | +-+-+ 7 rows in set (0.00 sec) |
Because the root account does not have a password by default, you can log in with the root role and view all the information without entering the password. If you log in to MySQL with a non-root role, you only have partial permissions to operate the database.
$mysqlmysql > show databases;+-+ | Database | +-+ | information_schema | | test | +-+ 2 rows in set (0.00 sec) mysql > use mysqlERROR 1044 (42000): Access denied for user'@ 'localhost' to database' mysql'
So the first thing MySQL does after installation is to set a password for root users, otherwise the database will have no security to speak of.
Mysql > GRANT ALL PRIVILEGES ON *. * TO root@localhost IDENTIFIED BY ""
Replace the above command with the password you want to set. The above command means to give all database permissions to root users who log in with a password on the local (localhost). After setting the password, you need to enter the password if you log in as a root user again, such as:
$mysql-u rootERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) $mysql-u root-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 75Server version: 5.5.34-0ubuntu0.13.10.1 (Ubuntu) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql >
Set up database independent users
Because the root user has all the permissions to operate the database, it cannot be easily provided to others. Multiple databases can be created in a single MySQL instance, which may belong to different projects, and each database has different operational roles. This can be accessed by specified users for a different database.
First create a database mysql > create database db_web_monitor using the root role, and then grant the database to a user named xavier to use mysql > GRANT ALL PRIVILEGES ON db_web_monitor.* TO xavier@localhost IDENTIFIED BY "xavier"
In this way, you can use the xavier user with the password of xavier to log in to MySQL locally to operate the db_web_monitor database.
$mysql-u xavierERROR 1045 (28000): Access denied for user 'xavier'@'localhost' (using password: NO) $mysql-u xavier-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 77Server version: 5.5.34-0ubuntu0.13.10.1 (Ubuntu) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c' to clear the current input statement.mysql > show databases;+-+ | Database | +-+ | information_schema | | db_web_monitor | | test | +-+ 3 rows in set (0.00 sec) mysql >
Open remote login permissions
1. First modify the configuration file of MySQL to allow you to listen for remote login.
$sudo vi / etc/mysql/my.cnf find the line 45 # Instead of skip-networking the default is now to listen only on 46 # localhost which is more compatible and is not less secure where bind-address is located. 47 bind-address = 127.0.0.1 change the bind-address value to native IP. Note the note that if it is an older version of MySQL, it should be skip-networking here, and you can comment it directly.
two。 The user is granted remote login permissions.
Mysql > GRANT ALL PRIVILEGES ON db_web_monitor.* TO xavier@ "" IDENTIFIED BY "xavier"
In this way, xavier users can access the native MySQL through IP on any host and operate on the db_web_monitor database.
At this point, I believe you have a deeper understanding of the "ubuntu 13.04 steps to install mysql database". 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.