Linux file transmission and MySQL Database Installation

Source: Internet
Author: User
Tags gz file localhost mysql

File Transfer tool usage


To speed upLinuxSystem learning should be put in place first, and the knowledge points used should be checked. Here we wantLinuxInstall a Service Trainer firstMySQLTry the database.

because I use Linux , and the virtual machine is still lite. I 've been wondering how to Windows export the following files to Linux In a depressing situation, the installation is centos cannot be opened. It will be gone in a flash! However, Ping Baidu website is accessible. Then you want to install the VM VMware Tools it was not successful. Later, I adjusted several virtual machine networking methods and did not solve the problem.

later I came up with a method, since I can use putty Remote Access Linux system, you can use FTP transfer files, since Linux supported SSH protocol, what about Baidu? FTP tool support SSH protocol.

There are many tools.WinscpOf course, if your VM is powerful, you don't have to use this method.WindowsTo the virtual machine.LinuxIn the system.

Winscp: It is easy to find free, two or threeMB.

After installation, the interface is as follows:

After login, localWindows XPFiles and remote services in the systemLinuxThe files in the system are displayed in the left and right forms.WindowsFind the file to be uploaded in the form and drag itLinuxThe upload operation can be completed in the form.

 

The problem of transferring files to the Linux system has been solved perfectly. The following describes how to install the MySQL database.



========================================================== ============ Gorgeous split line ============================== ================================

Install MySQL Databases in Linux


The first thought was too simple, because it was so simple in Windows that the installation can be completed by continuing to next. It is really difficult for new Linux users. I will use the simplest steps to tell you.

About MySql in Linux. You can download it on the official website (this is the best method), but you need to register for download. I am afraid of trouble, so I have downloaded it on several famous download websites (such as huajun, skysky, and extraordinary. It seems that MySql in Linux is more than twice as large as that in windows, generally more than one hundred MB. My assumption is:MySQL for Linux may be more powerful. Hey!

Perform the following operations:

First, upload the MySQL file toUsr/local/Directory

1. create user groups and users

 

[Root @ localhost local] #Groupadd MySQLAdd a MySQL Group
[Root @ localhost local] #Useradd-G MySQLAdd a MySQL user to the MySQL group in the following format:Useradd-G [group name] [user name]

TIPS:

Linux is a multi-user and multi-task operating system. Therefore, each file has the permission to specify the group of users.


Ii. decompress the file

[Root @ localhost local] #Tar zxfMysql-5.0.87-linux-i686-glibc23.tar.gz decompress .tar.gz File

TIPS:

The tar command is a reliable method for backing up files in Unix/Linux systems. It can work in almost any environment and has the permission of all users. The format is as follows:

Decompress: [********] $ tar zxvf filename.tar.gz


Compression: [********] $ tar zcvf filename.tar.gz dirname


[Root @ localhost local] #CD mysql-5.0.87-linux-i686-glibc23Open mysql-5.0.87-linux-i686-glibc23 directory
[Root @ localhost mysql-5.0.87-linux-i686-glibc23] #Ll view the decompressed directory structure
Total usage 164
Drwxr-XR-x 2 7155 wheel 4096 2009-10-16 Bin
-Rwxr-XR-x 1 7155 wheel 1153 2009-10-16 configure
-RW-r -- 1 7155 wheel 19071 2009-10-16 copying
Drwxr-x --- 4 7155 wheel 4096 2009-10-16 data
Drwxr-XR-x 2 7155 wheel 4096 2009-10-16 docs
-RW-r -- 1 7155 wheel 5139 2009-10-16 exceptions-Client
Drwxr-XR-x 3 7155 wheel 4096 2009-10-16 include
-RW-r -- 1 7155 wheel 8928 2009-10-16 install-binary
Drwxr-XR-x 2 7155 wheel 4096 2009-10-16 lib
Drwxr-XR-x 4 7155 wheel 4096 2009-10-16 man
Drwxr-XR-x 9 7155 wheel 4096 2009-10-16 mysql-test
-RW-r -- 1 7155 wheel 1410 2009-10-16 readme
Drwxr-XR-x 2 7155 wheel 4096 2009-10-16 scripts
Drwxr-XR-x 3 7155 wheel 4096 2009-10-16 share
Drwxr-XR-x 5 7155 wheel 4096 2009-10-16 SQL-statements
Drwxr-XR-x 2 7155 wheel 4096 2009-10-16 support-Files
Drwxr-XR-x 2 7155 wheel 4096 2009-10-16 tests


3. Set soft links

[Root @ localhost local] #Ln-s mysql-5.0.87-linux-i686-glibc23 MySQLAdd a soft link to the folder mysql-5.0.87-linux-i686-glibc23 MySQL

TIPS:

Soft links are similar to shortcuts. If the name of a directory is too long, I can add a link with a short name. In the example above, I open the MySQL directory and it actually enters the directory of the mysql-5.0.87-linux-i686-glibc23.


4. modify the configuration file

[Root @ localhost MySQL] #CP support-files/my-medium.cnf/etc/My. CNFSupport-files/My-medium.cnfGo to the ETC/directory and name it:My. conf 

[Root @ youname MySQL] #VI/etc/My. CNFOpen and edit the my. CNF file. For more information about VI commands, see the previous section.

Modify the following content:

 
.......
 [Mysqld] 
Port = 3306
Socket =/tmp/MySQL. Sock
Skip-locking
Key_buffer = 16 m
Max_allowed_packet = 1 m
Table_cache = 64
Sort_buffer_size = 512 K
Net_buffer_length = 8 K
Read_buffer_size = 256 K
Read_rnd_buffer_size = 512 K
Myisam_sort_buffer_size = 8 m

Datadir =/data/MySQLModify the datadir directory
.......
# Skip-FederatedSkip-federated is preceded by #, indicating that the service is commented out.
 
.......

The content to be modified is marked in red. Press C to switch the editing status and Press ESC to save and exit.

[Root @ localhost MySQL] #Mkdir-P/data/MySQLCreate/data/MySQL directory


5. Modify the user group described in the file

 

[Root @ youname MySQL] #Chown-R MySQL/data/MySQL/ [Root @ youname MySQL] #Ll/Data/ Total usage 8 Drwxr-XR-x 2 MySQL Root 4096 February 27 11:20 MySQL [Root @ youname MySQL] #Chgrp-R MySQL/data/MySQL/ [Root @ youname MySQL] #Ll/data/ Total usage 8 Drwxr-XR-x 2 MySQL 4096 February 27 11:20 MySQL

TIPS: 

ChgrpCommand to change the user group to which a file or directory belongs ChownCommand explanation purpose: Change the owner or group associated with the file.

[Root @ localhost MySQL] #./Scripts/mysql_install_db -- user = MySQLInitialize the MySQL database

[root @ localhost MySQL] # LL/data/MySQL/ View permissions under the MySQL directory
total usage: 680
drwx ------ 2 MySQL Root 4096 February 27 22:16 mysql
-RW ---- 1 MySQL 15204 February 27 22:16 mysql-bin.000001
-RW ---- 1 MySQL 639172 February 27 22:16 mysql-bin.000002
-RW ---- 1 MySQL 38 February 27 22:16 mysql-bin.index
drwx ------ 2 MySQL Root 4096 February 27 22:16 test

[Root @ localhost MySQL] #Chown-r mysql. MySQL/data/MySQL/Initialize all files in data/MySQL/to MySQL user permissions.


6. Start the MySQL Service

 

[Root @ localhost bin] #CD/MySQL/binGo to the MySQL/bin directory

[Root @ localhost bin] #./Mysqld_safe -- user = MySQL &Start MySQL Service

[root @ localhost bin] # export Path = $ path:/usr/local/MySQL/bin/ set the path of MySQL
[root @ localhost bin] # mysql-uroot Start mysql-uroot directly
welcome to the MySQL monitor. commands end with; or \ G.
your MySQL connection ID is 1
server version: 5.0.87-log MySQL Community Server (GPL)

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql>

Haha! It is not easy to successfully enter mysql. Although there are not many steps, it takes me a lot of time. Be proud of yourself!



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.