Linux Study Notes 2_mysql installation, Study Notes 2_mysql

Source: Internet
Author: User
Tags install perl

Linux Study Notes 2_mysql installation, Study Notes 2_mysql

There are many commands for viewing file content: cat, tac, more, less, head, tail, nl.

Cat displays the file content from the first line. tac displays the file content from the last line. You can see that tac is a reverse write of cat. more displays the file content on one page; less is similar to more, but it is better than more, it can flip forward; head only looks at the first few lines; tail only looks at the last few lines; When nl is displayed, the line number is output; od reads files in binary format ......

This article briefly introduces the history of the main Linux branches and linux branches.

Here, I am reading this book "Linux is the model". The style of the article is not my taste, and there are many network extensions in it, it must have been intentionally done by the author to narrow down the distance with the reader, but it does not feel any other effect. There are also some cool-winded poems, such as the poems of Xi Murong at the beginning of chapter 1, it is of little use. I can only say that "I have finished reading it". There are too many things, and many of them can be explained in more detail, but they have been taken over, for example, some concepts and design concepts should be clearer, more direct, and more detailed, and have semantic ambiguity and text defects. If you are a newbie and do not have a powerful search engine, reading this book will be inefficient.

Shell is a special program that provides interaction between users and Unix/Linux operating systems. shell itself is an interpreted programming language. The first mainstream shell is the Bourne shell, named after the inventor Steven Bourne. It became popular with Unix 7 in 1979. In Unix systems, the program name of the Bourne shell is sh. Bash, also known as Bourne again shell, was born in 1988. It is a superset of Bourne shell, fully compatible with the latter and has more features and functions. In Unix and Linux systems, the bash program name is bash. In Unix systems, the program sh is different from bash. in Linux systems, there is also a program named sh, but it is not a real Bourne shell, it is a symbolic connection (soft connection) pointing to the bash program. This symbolic connection is set to run the Bourne shell script without modification in Linux, bash is actually running.

For more information about the Linux interface, see-basic knowledge about the linux graphic interface (relationships between X, X11, Xfree86, Xorg, GNOME, and KDE)

The file organization in Linux makes me feel refreshed and mount-based installation feels great. It is found that some improvements made by Microsoft are based on Linux, such as the installation-free and copy-only features of. Net software. Speaking of this, we have to talk about the registry of classics (tens of thousands. At the beginning of windows, there was no registry like unix. Its program information was in a text file suffixed with ini. Later, Windows introduced the registry, which is advanced in some aspects. At least the Registry serves as the core database of the entire system. Information management was unified and a unified programming API was opened. It allows the operating system and applications to share information, which can work collaboratively between the operating system and the software and between the software. A simple example is that an application can open word and excel documents. If it writes this information into this shared database, the system and other applications can be found when you open word and excel documents. Linux configurations are mainly in the/etc and/home/user names. The non-registered configuration method has the biggest advantage of "copy as installation". In my opinion, in terms of user experience, with this advantage, you can kill the Registry in seconds. However, if you can unify the advantages of the two, that is, free of registration but unified management, it is best to see how the operating system can be implemented after several generations.

Install software in Linux

First, try to use the source code to install the software. Take installing Community version mysql as an example. Source package address: http://dev.mysql.com/get/downloads/mysql-5.6/mysql-5.6.26.tar.gz. The official website provides detailed installation instructions and concepts.

Specify the directory where the package is to be saved first. We recommend that you put all downloaded source code packages under the/usr/local/src/directory. This is not necessary, but an agreement.

# Cd/usr/local/src/

Use the wget command to download then, # wget http://dev.mysql.com/get/downloads/mysql-5.6/mysql-5.6.26.tar.gz.

Wget is used to [recursively] download network files.

Then extract source package # tar-zxvf mysql-5.6.26.tar.gz

What is then's next step? Through # more mysql-5.6.26/README to see the prompt, said to go to the official website to see the document, the official website said the source code to install mysql, need to pre-install CMake, make, ansi c ++ compiler, Perl.

Make and gcc (although the official website only says that gcc can be installed, but the practice has proved that g ++ needs to be installed, see the following ), perl # rpm-qa XXX has been installed and the version meets the requirements. skip this step.

Cmake, which was originally intended to be downloaded and installed with wget, is helpless due to national conditions. The download speed for connecting to foreign websites is too slow. It takes half an hour to download 6 m Files. Listen to your suggestions, use yum to install # yum install cmake. For more information about cmake, see makefile in Linux. The differences between cmake and make are as follows.

Man: cmake, multi-line black and white text of 17 K, or English, indicates that it has been dizzy in the toilet. If you want to view the set of Command Options supported by cmake, see MySQL Source-Configuration Options.

Now I only need to ensure that the installation is successful, so I can simply browse multiple options and execute cmake directly. The unexpected (contradictory rhetoric) error is: Curses library not found. please install appropriate package ......

The Curses library is a ghost. After checking the information, it seems that the differentiated processing of different terminals is encapsulated into a unified interface. In the old non-desktop system, this reduces the workload of software development for interfacing with various systems, such as the same line feed action. The input parameters defined by different terminals are different, curses library encapsulates these differences. For more information, see http://heather.cs.ucdavis.edu /~ Matloff/UnixAndC/CLanguage/Curses.pdf.

The Curses library and then cmake are still installed in yum every minute, telling me that CMAKE_CXX_COMPILER is not specified. Do you still need to explicitly specify this stuff? so,-DCMAKE_CXX_COMPILER = gcc, and an error is still reported, probably:/bin/gcc broken -- not able to compile a simple test program balabala. Cannot solve the problem! Later, I carefully read the output error details and found the following sentence:Gcc:ErrorTrying to exec'Cc1plus': Execvp: No such file or directory. Cc1plus seems to have something to do with c ++. Can't gcc compile c ++? Without relevant knowledge, the blogger tried to install g ++ Based on the clues on the Internet, and then cmake (without specifying CMAKE_CXX_COMPILER). No error was reported this time, and the words Generating done appeared, the eyes of bloggers burst into tears.

So far, we have only completed the Configure step, followed by Build, # make. This process lasted for about 15 minutes and went smoothly. Next, we chose Install, # make install: It looks very smooth. If it is less than half a minute, no error is reported and no success prompt is displayed. As mentioned above, install should be a file mounting process for Linux, which is different from the registration and installation mode for windows. maybe is the reason for the installation process to be so low-key :).

Configure and start mysql

Note: For convenience, the above installation process is completed by the root. For security, we need to assign a dedicated account to mysql, such as dber. You can type cat/etc/passwd | grep dber to check whether the user name already exists. If no, use the useradd and passwd commands to create a user and set a password. By default, a user group named dber is created. You can use groupadd mysql to create a user group named mysql, use usermod-g mysql dber to change the dber user group to mysql, and then groupdel dber to delete the dber user group. You can specify a user group when creating a user. Then

# Chown-R dber: mysql/usr/local/mysql

Change the user and User Group of the mysql directory. Now you can use ls-ld/usr/local/mysql to view the attributes and permissions of the mysql directory. The result is: drwxr-xr-x. 13 dber mysql 4096 Aug mysql. Dber has the rwx permission. Use su dber-to switch the current user to dber.

Run mysql_install_db.Mysql_install_dbInitializes the MySQL data directory and creates the system tables that it contains. The system prompts that the perl module Data: Dumper, yum install perl-Data-Dumper is missing. Then execute mysql_install_db, and then output a prompt indicating that a configuration file is generated in the path/usr/local/mysql/my. cnf, And the/etc/my. the cnf configuration file will be read first, so, or remove (delete or rename) the latter, or specify it when starting the service. Go to the bin directory./mysqld_safe -- defaults-file =/usr/local/mysql/my. cnf to start the service. -- defaults-file indicates the configuration file to be read.

Configuration items for my. cnf are described in http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html

Unfortunately, what log records are output to XXX. err on the screen, and then another line is being started, so there will be no more information (mysql should be started at this time ). Check the err file and see the prompt: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use -- explicit_defaults_for_timestamp server option. Use vi to edit my. cnf and add a line of explicit_defaults_for_timestamp = true. For more information, see the TIMESTAMP changes in MySQL 5.6.

Start mysql

Now, you can directly type./mysql to log on to the mysql service and use select user (); to check whether the current user is dber. Show databases; use xxxdatabase; select * from xxxtable; run smoothly.

Mysql has multiple data engines to choose from: ISAM, MyISAM, HEAP, InnoDB, and Berkley (BDB) and so on-you can also use MySQL ++ to create your own database engine-the applicable scenarios are different, you can specify different data engines for different tables, for example, you can set tables that require transaction processing to InnoDB, and set other tables to MyISAM to improve query performance as much as possible.

The recording status of vi, which is the record button status. In general mode (command mode), if q is not followed by a colon, it enters this state. After you press q, the first letter or number you press is the shortcut key of the press macro. When using @ and the first letter or number you recorded, You can execute the key macro you just edited. Do not panic when entering recording. Press esc and then press q to exit recording. : Wq forcibly writes to the file and exits (Save the disk and exit write % quite ). Write the file forcibly even if it is not modified, and update the modification time of the file. : X write the file and exit. The file is written only when the file is modified, and the file modification time is updated; otherwise, the file modification time is not updated.

In text mode, what commands can be used to connect to WiFi or set network connections? Every time you connect to WiFi, you have to switch to the graphic interface. It feels too low!

 

Other references:

Compile and install MySQL 5.6.14 in CentOS 6.4

 

Reprinted please indicate the source of this article: http://www.cnblogs.com/newton/p/4712213.html

You don't need to read the following. It's irrelevant to the topic of this article. It will be removed later!

Plug: I always thought that there are too many superconnections on the page, which is difficult to reduce transmission efficiency. In fact, this is not accurate. This is true in Http1.0, but now it basically uses Http1.1. In file requests in the same domain, multiple files can send multiple HTTP requests and responses in one HTTP connection; if you set Connection to "close", the effect will be the same as Http1.0. Another problem has always plagued me: when the server has not yet returned the request, the request is terminated (such as clicking the stop button or closing the page to close the browser), the server should continue to execute unfinished business logic, but after the execution is completed, will the result be returned? The key is that it is unclear whether the connection is closed at the time of request termination. If you know, please let me know. Thank you!

Insert: http post Request Message format

Insert :. the H file is a declaration file and can be placed with class declaration and definition ;. the cpp file is an implementation file that can be defined by classes. Generally. the cpp file should contain a file with the same name. h file.

Plug: Use NuGet to manage the project library

Plug: Evolution of parameter verification methods in C #

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.