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 use mysql under fedora 16

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to install and use mysql under fedora 16, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Install Mysql

1. Installation files of MySQL

The following two files are required to install MySQL:

MySQL-client-5.1.55-1.glibc23.i386.rpm

MySQL-server-5.1.55-1.glibc23.i386.rpm

Download address: http://mirrors.sohu.com/mysql/MySQL-5.1/

You can use: www.2cto.com

Yum install mysql-server for installation

2. Install MySQL

The rpm file is a software installation package developed by Red Hat, and rpm eliminates many complicated procedures when installing the software package. The commonly used parameter for this command during installation is-ivh, where I indicates that the specified rmp package will be installed, V indicates the details of the installation, and h indicates that the "#" symbol appears during installation to show the current installation process. This symbol will not stop until the installation is complete.

1) install the server side

Run the following command in a directory with two rmp files:

[root@test1 local] # rpm-ivh MySQL-server-5.1.55-1.glibc23.i386.rpm

Reminder:

If the following appears

Error: Failed dependencies:

Perl (DBI) is needed by MySQL-server-5.1.16-0.glibc23.i386

Please use the

Yum install perl-DBI can be installed, of course, in terms of different distributions.

The following information is displayed.

Warning: MySQL-server-5.1.55-1.glibc23.i386.rpm

Signature: NOKEY, key ID 5072e1f5

Preparing... # # [100%]

1:MySQL-server # # [100%]

. (omit display)

/ usr/bin/mysqladmin-u root password' new-password'

/ usr/bin/mysqladmin-u root-h test1 password' new-password'

. (omit display)

Starting mysqld daemon with databases from / var/lib/mysql

If the above information appears, the server installation is complete. Test whether you can run netstat successfully to see whether the Mysql port is open. If it is opened, it means that the service has been started and installed successfully. The default port for Mysql is 3306.

[root@test1 local] # netstat-nat

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

Tcp 0 0 0.0.0.0 3306 0.0.0.015 * LISTEN

The above shows that the MySQL service has been started.

2) install the client

Run the following command: www.2cto.com

[root@test1 local] # rpm-ivh MySQL-client-5.1.55-1.glibc23.i386.rpm

Warning: MySQL-client-5.1.55-1.glibc23.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

Preparing... # # [100%]

1:MySQL-client # # [100%]

Shows that the installation is complete.

Use the following command to connect to mysql and test for success.

Log in to MySQL

The command to log in to MySQL is mysql, and the syntax for mysql is as follows:

Mysql [- u username] [- h host] [- p [password]] [dbname]

Username and password are the user name and password of MySQL, respectively. The initial administrative account number of mysql is root, and there is no password. Note: this root user is not a system user of Linux. The default user of MySQL is root, and since you don't have a password initially, you only need to type mysql when you enter it for the first time.

[root@test1 local] # mysql

Welcome to the MySQL monitor. Commands end with; or / g.

Your MySQL connection id is 1 to server version: 4.0.16-standard

Type 'help;' or' / h' for help. Type'/ c'to clear the buffer.

Mysql >

The "mysql >" prompt appears. Congratulations, the installation is successful!

After adding the password, the login format is as follows:

Mysql-u root-p

Enter password: (enter password)

The user name is followed by-u, and the password is required by-p. Enter the password at the place where you enter the password.

Note: this mysql file is in the / usr/bin directory and is not the same as the startup file / etc/init.d/mysql described later.

Www.2cto.com

Set password and access to MYSQL under Linux:

Set the database password [root@localhost ~] # mysqladmin-u root password "password"

Access the my command: [root@localhost ~] # mysql-u root-p → enter the password by typing enter

The default information for mysql installation using rpm is as follows:

1) Database directory / var/lib/mysql/

2) configuration file / usr/share/mysql (mysql.server command and configuration file)

3) related commands / usr/bin/ (mysqladmin mysqldump)

4) start script / etc/rc.d/init.d/

5) the default port is 3306

The above is all the contents of the article "how to install and use mysql under fedora 16". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Wechat

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

12
Report