Linux file transmission and mysql Database Installation

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

File Transfer tool usage
 
 
 
 
In order to speed up learning about linux systems, you should first put them in one place, and find the knowledge point you use. Here, you want to install some service trainers in linux. The first thing you think of is to install a mysql database.
 
I use linux under a virtual machine, and the virtual machine is still lite. I have been wondering how to import files under windows to linux. What is depressing is that the installed centOS cannot be opened, and it will be gone in a flash! However, ping the Baidu website is successful. Then I tried to install VMware tools on the virtual machine, but I didn't solve the problem after I adjusted several networking methods of the virtual machine.
 
Later I came up with a method. Since I can remotely access the linux system through PuTTY, I can transmit files through FTP. Since linux supports the SSH protocol, I would like to look at what FTP tool Baidu supports the SSH protocol.
 
There are a lot of tools. I chose winSCP here. Of course, if your virtual machine is powerful, you don't have to use this method, simply drag the files under windows to the linux system under the virtual machine.
 
WinSCP: it is easy to find a free, two or three MB size.
 
After installation, the interface is as follows:
 
 
 
After login, the files in the local windows XP system and those in the remote linux system are displayed in the left and right forms respectively. We find the files to be uploaded in the windows form, you can drag the file to the linux form to perform the upload operation.
 
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 that mysql in linux may be more powerful. Hey!
 
Perform the following operations:
 
First, upload the mysql file to the usr/local/directory of the linux system.
 
1. create user groups and users
 
 
 
 
[Root @ localhost local] # groupadd mysql to add a mysql Group
[Root @ localhost local] # useradd-g mysql adds a mysql user to the mysql group. 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 zxf mysql-5.0.87-linux-i686-glibc23.tar.gz decompress the .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-glibc23 open 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 mysql Add 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. cnf copy file support-files/my-medium.cnf to the etc/directory and name it my. conf
 
[Root @ youname mysql] # vi/etc/my. cnf open and edit the my. cnf file. The previous section briefly introduces how to operate vi commands.
 
Modify the following content:
 
.......
[Mysqld] port = 3306 socket =/tmp/mysql. sockskip-lockingkey_buffer = bytes = 1Mtable_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = bytes = 8 Mdatadir =/data/mysql modify the datadir directory ....... # Add # Before skip-federated to comment out the service.
.......
Copy code
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/mysql CREATE/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:
 
The chgrp command is used to change the user group to which a file or directory belongs.
Detailed usage of the chown command: Change the owner or group associated with the file.
 
 
 
 
[Root @ localhost mysql] #./scripts/mysql_install_db -- user = mysql initialize 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 under data/mysql/to mysql user permissions
 
 
 
 
6. Start the mysql Service
 
 
 
 
[Root @ localhost bin] # enter the mysql/bin directory for cd/mysql/bin.
 
[Root @ localhost bin] #./mysqld_safe -- user = mysql & start the mysql Service
 
[Root @ localhost bin] # export PATH = $ PATH:/usr/local/mysql/bin/set the PATH of mysql
[Root @ localhost bin] # Start mysql-uroot directly with mysql-uroot
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!

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.