(iii)-linux file transfer and MySQL database installation

Source: Internet
Author: User
Tags gz file mysql create mysql in

The File Transfer tool uses

In order to crash, the study of Linux system is put first, which knowledge point to check which, here want to install some services in Linux practiced hand, the first thought is to install a MySQL database to try.

Because I am using Linux under the virtual machine, and the virtual machine is a lite version. have been thinking about how to put Windows under the file Guide to Linux, depressed is installed CentOS can not open, a flash will not! But Ping Baidu website is pass. Then I tried to install VMware Tools for the virtual machine, and then tweaked some of the networking options for the virtual machine and didn't solve the problem.

Later thought of a way, since I can remotely access the Linux system through the putty, you can transfer files via FTP, since Linux supports SSH protocol, then Baidu what FTP tool support SSH protocol.

A lot of tools, I choose WINSCP here, of course, if your virtual machine to force, you do not have to go through this way, directly to the windows of the following files to the virtual machine under the Linux system to drag the line.

WinSCP : It's easy to find free, two or three MB of volume.

The post-installation interface is as follows:

After logging in, the files under the local Windows XP system and the files under the remote Linux system are displayed in the left and right two windows, we find the files that need to be uploaded in the Windows Form, and drag them into the Linux form for uploading.

OK, the problem of transferring files to a Linux system is perfectly resolved, and the MySQL database is installed below.

MySQL database installation under Linux

It's so easy at first, because it's so simple under windows that you can continue all the way to the next step to complete the installation. It's a bit hard for Linux novices to do. When I will use the most detailed and simple steps to tell you.

About the Linux version of MySQL. You can go to the official website to download (this is the best way), but need to register to download, I am afraid of trouble, so in a few famous (Huajun, sky, extraordinary, etc.) of the download site. Seemingly, the Linux version of MySQL than the Windows version of more than a large number, generally more than 100 MB. My assumption is that the Linux version of MySQL may be more powerful. Hee Hee

Here's how to get started:

First, upload the MySQL file to the usr/local/directory of the Linux system.

First, create user groups and users


[[email protected] local]# groupadd mysql add a MySQL group
[[email protected] local]# useradd-g mysql mysql in MySQL group add a MySQL user, format:useradd-g [group name] [user name]

Small knowledge:

Linux is a multi-user multitasking operating system, so each file will have a specific set of users which permissions.

Second, unzip the file

[[Email protected] local]# tar zxf mysql-5.0.87-linux-i686-glibc23.tar.gz unzip. tar.gz file

Small knowledge:

The tar command is a reliable way to back up files in a unix/linux system and works in almost any environment, with permissions for all users. The format is as follows:

Decompression: [*******]$ tar zxvf FileName.tar.gz

Compression: [*******]$ tar zcvf FileName.tar.gz DirName

[[Email protected] local]# CD mysql-5.0.87-linux-i686-glibc23 Open mysql-5.0.87-linux-i686-glibc23 Directory
[[email protected] mysql-5.0.87-linux-i686-glibc23]# ll view Unzip directory structure
Total Dosage 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--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--r--1 7155 wheel 5139 2009-10-16 exceptions-client
Drwxr-xr-x 3 7155 wheel 4096 2009-10-16 include
-rw-r--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--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-bench
Drwxr-xr-x 2 7155 wheel 4096 2009-10-16 support-files
Drwxr-xr-x 2 7155 wheel 4096 2009-10-16 tests

Third, set up a soft link

[[email protected] local]# ln-s mysql-5.0.87-linux-i686-glibc23 MySQL Add a soft link to the folder mysql-5.0.87-linux-i686-glibc23 MySQL

Small knowledge:

A soft link is somewhat similar to the concept of a shortcut. If a directory name is too long, I can add a short name to the link, as the above example, I opened the MySQL directory, in fact, entered the MYSQL-5.0.87-LINUX-I686-GLIBC23 directory.

Iv. Modifying configuration files

  

[[email protected] mysql]# cp support-files/my-medium.cnf/etc/my.cnf copy file support-files/my-medium.cnf to etc/directory and name: my . conf

[[email protected] mysql]# vi/etc/my.cnf Open the edit my.cnf file, the operation of the VI command, the previous section has a brief introduction.

Modify the following content:

.......
[Mysqld]port            = 3306socket =          /tmp/mysql.sockskip-lockingkey_buffer = 16mmax_allowed_packet = 1mtable_cache = 64sort_buffer_size = 512knet_buffer_length = 8kread_buffer_size = 256kread_rnd_buffer_size = 512Kmyisam_sort_buffer_ Size = 8mdatadir=/data/mysql   Modify the directory of the DataDir .... #skip-federated skip-federated in front of the     # sign, indicating that the service is commented out.
.......

The red label is what needs to be modified, press C to toggle the edit state, press ESC, WQ save to exit

[[email protected] mysql]# mkdir-p/data/mysql Create/data/mysql Directory

V. Modify the user group described in the file

[[email protected] mysql]# chown-r mysql/data/mysql/[[email protected] mysql]# ll/data/total usage 8drwxr-xr-x 2 MySQL root 40 96 February 11:20 Mysql[[email protected] mysql]# chgrp-r mysql/data/mysql/[[email protected] mysql]# ll/data/Total usage 8drwxr- Xr-x 2 mysql mysql 4096 February 11:20 MySQL

Small knowledge:

chgrpcommand to change the user group to which the file or directory belongs ChownCommand detailed purpose: Change the owner or group associated with the file. [[email protected] mysql]#./scripts/mysql_install_db--user=mysql Initialize MySQL database

[[email protected] mysql]# ll/data/mysql/View permissions in MySQL directory
Total Dosage 680
drwx------2 MySQL root 4096 February 22:16 MySQL
-RW-RW----1 mysql mysql 15204 February 22:16 mysql-bin.000001
-RW-RW----1 mysql mysql 639172 February 22:16 mysql-bin.000002
-RW-RW----1 MySQL mysql 38 February 22:16 Mysql-bin.index
drwx------2 MySQL root 4096 February 22:16 test

[[email protected] mysql]# Chown-r mysql.mysql/data/mysql/The files under data/mysql/are initialized to MySQL user rights

Vi. start the MySQL service


[[email protected] bin]# Cd/mysql/bin into the Mysql/bin directory

[[email protected] bin]#./mysqld_safe--user=mysql & start MySQL service

[Email protected] bin]# export path= $PATH:/usr/local/mysql/bin/Set the path path for MySQL
[[email protected] bin]# Mysql-uroot Direct mysql-uroot start
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>

Ha ha! Successfully entered MySQL, not easy ah, although the steps are not many, but also cost me a lot of time. Be Proud of yourself!

(iii)-linux file transfer and MySQL database installation

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.