In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the steps of MySQL installation in Fedora9 database". In the daily operation, I believe that many people have doubts about the steps of MySQL installation in Fedora9 database. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "steps for MySQL installation in Fedora9 database". Next, please follow the editor to study!
1. A total of 10 MySQL installation packages are found in the CD, but all of them need to be installed.
Libdbi-dbd-mysql-0.8.3-1.fc9.i386.rpm
Mysql-libs-5.0.51a-1.fc9.i386.rpm
Mod_auth_mysql-3.0.0-6.i386.rpm
MySQL-python-1.2.2-6.fc9.i386.rpm
Mysql-5.0.51a-1.fc9.i386.rpm
Mysql-server-5.0.51a-1.fc9.i386.rpm
Mysql-connector-java-3.1.12-5.fc9.i386.rpm
Perl-DBD-MySQL-4.005-8.fc9.i386.rpm
Mysql-connector-odbc-3.51.24r1071-1.fc9.i386.rpm
Php-mysql-5.2.5-7.fc9.i386.rpm
2. Check which MySQL software is installed in the system
# rpm-qa | grep mysql-I # the-I here is case-insensitive
3. MySQL installation server side
Due to the lack of dependent packages, I installed it directly using the following MySQL
# yum-y install mysql mysql-server mysql-libs
4. Initialize the database
# cd / usr/bin/
#. / mysql_install_db / / initialize the database
If successful, the following message appears
[root@localhost bin] #. / mysql_install_db
Installing MySQL system tables...
OK may have some warning messages
5. Log in to the database
To log in to MySQL command, you can use mysql,mysql as follows:
Mysql-u username-h host-p password database name
[root@test1 local] # mysql
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 installation file is in the / usr/bin directory, which is not the same as the startup file / etc/init.d/mysql described later.
6. Several important directories for MySQL installation
After MySQL installation is completed, unlike SQL Server installed in a directory by default, its database files, configuration files and command files are in different directories, it is very important to understand these directories, especially for Linux beginners, because the directory structure of Linux itself is more complex, if you do not understand the installation directory of MySQL, it is impossible to learn in depth.
Let's introduce these catalogs.
Database directory
/ var/lib/mysql/
Configuration file
/ usr/share/mysql (mysql.server commands and configuration files)
Related command
/ usr/bin (mysqladmin mysqldump, etc.)
Startup script
/ etc/rc.d/init.d/mysqld (directory of startup script file mysql)
7. Common operations of MySQL installation database
Note: end each command in MySQL with a semicolon ";"
Mysql > show databases
| | Database |
| | information_schema |
| | mysql |
| | test |
3 rows in set (0.00 sec)
In fact, the above database mysql is very important, it contains MySQL installation system information, password changes and the addition of new users, in fact, is operating this database.
8. Display the tables in the database
Mysql > use mysql; / / first open the database.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-A
Database changed
Mysql > show tables; / / displays the table. | | Tables_in_mysql |
| | columns_priv |
| | db |
| | func |
| | user_info |
18 rows in set (0.00 sec)
9. Display the structure of the data table:
Describe table name
10. Build a database:
Create database library name
For example: create a library with the first name bit wangxiuhua
Mysql > create databases wangxiuhua
Query OK, 1 row affected (0.00 sec)
11. Establish a data sheet
Use library name
Create table table name (list of field settings)
Mysql > create table xingming (id int (3) auto_increment not null primary key,xm char (2), csny date)
Query OK, 0 rows affected (0.00 sec)
12. Establish the data sheet for MySQL installation
Describe command to view the table structure you just created
Mysql > describe xingming
| | Field | Type | Null | Key | Default | Extra | |
| | id | int (3) | NO | PRI | NULL | auto_increment |
| | xm | char (2) | YES | | NULL |
| | csny | date | YES | | NULL |
3 rows in set (0.00 sec)
12. Add records
For example: add several related records.
Mysql > insert into name values ('Wang Xiuhua', 'male', '1980-05-05')
Mysql > insert into name values ('Yanyan', 'female', '1980-05-05')
You can use the select command to verify the results.
Mysql > select * from name
13. Display the records in the table:
Select * from table name
For example: display records in the user table in the mysql library. All users who can install user actions on MySQL are in this table.
Select * from user
Mysql > select * from xingming
| | id | xm | csny | |
| | 1 | | 1978-05-05 |
| | 2 | | 1980-05-05 |
2 rows in set (0.00 sec)
At this point, the study on the "steps to install MySQL in the Fedora9 database" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.