Linux Learning Note 2_mysql installation

Source: Internet
Author: User

There are many commands to view the contents of a file: Cat, TAC, more, less, head, tail, NL.

Cat starts displaying the contents of the file from the first line; The TAC starts with the last line, and it shows that the TAC is the backward write of cat; more than a page-by-page display of the contents of the file; Less is similar to more, but better than more, it can page forward; Tail only look at the tail a few lines; When NL is displayed, the output line number; od reads the file in binary mode ...

On the main branch of Linux, the history of the Linux Branch has a simple and concise summary.

Here in the trough, I am currently looking at this "Linux is this style", the language is not my taste, there are many network stems, presumably the author in order to close and the reader's distance, deliberately for it, but there is no other role, but also some hustled, such as the beginning of the 3rd Chapter XI Murong Poetry, It is not much use, I can only say "I have read it", too much nonsense, many can be more detailed explanation of the instead of a pen, such as in some concepts and design concepts should be able to express more clearly more direct & more detailed, there are some semantic ambiguity and language defects. In books, if you are a novice, if you do not have a strong search engine, reading this book (gradually mastering Linux) will be very inefficient.

The shell is a special program that provides interaction between the user and the Unix/linux operating system, and the shell itself is an interpreted programming language. The first mainstream shell was the Bourne shell, named after the inventor Steven Bourne's surname, which was released in 1979 with UNIX version 7 and became popular. In Unix systems, the Bourne shell program is named Sh. Bash, The Bourne again Shell, was born in 1988 and is a superset of the Bourne Shell, fully compatible with the latter and has more features and functionality. In Unix and Linux systems, Bash's program name is bash. In the UNIX system, the program SH is different from bash, and in the Linux system, there is a program named SH, but it is not the real Bourne shell, it is a symbolic connection (soft connection) pointing to Program Bash, the symbolic connection is set to make Bourne Shell scripts run under Linux without modification, and when you run SH under Linux, Bash is actually running.

See thebasic knowledge of Linux graphical interface (the relationship between X, X11, Xfree86, Xorg, GNOME, KDE)

The Linux file organization really makes me refreshing, mount-mount feels awesome. Found some of Microsoft's improvements are learning Linux, such as. NET software to install, copy can be used features. Speaking of which, we have to say the registration form of the (million) code (evil). Windows started off with a Unix-like registry, and its program information is in a text file with the suffix INI. Later, Windows introduced the registry, in some ways, or advanced, at least the registry serves as the core database of the entire system, information management unified and open a unified programming API. It allows the operating system and applications to share information, which works together between the operating system and software, and between software and software. A simple example is an app that opens Word, Excel documents, and if it writes this information into the shared database, the system and other apps can find it when they open Word, Excel documents. Various types of Linux configuration mainly in/etc and/home/user name, non-registered configuration, the biggest advantage is "copy is Installed", personally feel that on the user experience, single this advantage can be seconds to kill the registry. However, if the two advantages can be unified, that is, registration but can be unified management, it is best to see the operating system after a few generations to achieve it.

Install software under Linux

First try using the source code installation software to install the community version of 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 has more detailed installation instruction and the concept explanation.

First specify the directory to save this package, it is recommended to put all the downloaded source package into the/usr/local/src/directory, this is not necessary, but a contract.

# CD /usr/local/src/

Then use the wget command to download, # wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.26.tar.gz.

wget, for [recursive] download network files.

Then unzip the source package # TAR-ZXVF mysql-5.6.26.tar.gz

Then what's next? Through the # more mysql-5.6.26/readme See the hint, said to the official website to see the document, official online said source installation MySQL, need to pre-install CMake, make, ANSI C + + compiler, Perl.

MAKE,GCC ( Although the official website only said that the installation of GCC can be, but the practice proved to install g++, see below ), Perl with # Rpm-qa XXX view has been installed, and the version to meet the needs, skip.

CMake, originally intended to use wget download installation, frustration caused by national conditions, the download speed of connection to foreign websites is too slow, 6M of the file to the next half an hour, listen to friends recommend, use yum Install # Yum installed CMake. For cmake related concepts, see: Makefile Files in Linux, CMake and make differences.

Man a bit cmake,17k more lines of black and white text, or in English, that has been seen dizzy in the toilet. For a collection of command options supported by CMake, see MySQL source-configuration options

I now just ensure that the installation can be successful, so many options can be browsed once, so directly execute cmake, unexpectedly (contradictory rhetoric) Error: Curses library not found. Please install the appropriate package ...

Curses Library is a ghost, check the data, it seems to be different terminals of the same behavior of the differential processing package into a unified interface. This is in the old non-desktop system, can reduce and various systems docking software development workload, such as the same line break action, different terminal defined input parameters are not the same, and the curses library encapsulates these differences. More content can be found in http://heather.cs.ucdavis.edu/~matloff/UnixAndC/CLanguage/Curses.pdf.

Still use Yum minutes installed curses Library,then CMake, told me not to specify Cmake_cxx_compiler, wipe, this thing also need to explicitly specify, SO,-DCMAKE_CXX_COMPILER=GCC, still error, Probably mean:/BIN/GCC broken--not able to compile a, simple test program Balabala. Try not to solve it! Later carefully looked at the output of the error details, found this:gcc: error trying to exec 'cc1plus': execvp:no such file or directory. Cc1plus look at the name seems to have something to do with C + +, can't gcc compile C + +? Bo Master No related knowledge accumulation, according to the internet to find clues to try to install g++, and then CMake (no designated Cmake_cxx_compiler), this time no error, look at generating done word appeared, bo the eyes of the main point of tears.

So far, we have only completed the Configure steps, followed by build,# make can, the process lasted 15 minutes or so, very smooth; Next is install,# make install, is also very smooth appearance, half a minute, no error, no hint of success. As mentioned earlier, install for Linux should be a file mount process, different from the Windows Registration installation mode, maybe this is the installation process so low-key reason:).

Configure and start MySQL

Note that for convenience, the above installation process is done by root. For security reasons, we need to assign a dedicated account to MySQL, such as Dber, which you can type in CAT/ETC/PASSWD | grep Dber to see if the user name already exists. If not, use the Useradd and passwd commands to create a new user and set a password, and by default a user group named Dber is created, and we can use Groupadd MySQL to create a user group named MySQL and then use usermod-g MySQL Dber Change the Dber user group to MySQL, and then Groupdel dber Delete the Dber user group. Of course, you can specify a user group when you create a user. And then

# Chown-r Dber:mysql/usr/local/mysql

Change the user and user groups that the MySQL directory belongs to. Now use Ls-ld/usr/local/mysql to view the MySQL directory properties and permissions, display: Drwxr-xr-x. Dber mysql 4096 23:18 MySQL. You can see that Dber has rwx permissions. Use SU dber-to switch the current user to Dber.

Execute mysql_install_db. mysql_install_db initializes the MySQL data directory and creates the system tables that it contains. Tip Missing Perl module Data::D umper,yum install Perl-data-dumper. Then execute the mysql_install_db, after the output prompt message said to generate a configuration file, path/usr/local/mysql/my.cnf, and the CentOS system installation generated/etc/ The MY.CNF configuration file is read first, so that it is either removed (deleted or renamed) or otherwise specified when the service is started. Go to the Bin directory,./mysqld_safe--defaults-file=/usr/local/mysql/my.cnf start the service, where--defaults-file specifies the configuration file to read.

A detailed description of the configuration item for MY.CNF in http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html

Unfortunately, the output line on the screen is logged to Xxx.err, and then another line is being started, and then there is no context (and then it turns out that MySQL should have started successfully ). Look at that err file and see the hint: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Use--explicit_defaults_for_timestamp server option. Edit my.cnf with VI, plus a line of explicit_defaults_for_timestamp=true. See the TIMESTAMP changes in MySQL 5.6 for more information

Play MySQL.

Now we can type./mysql log in to the MySQL service, using Select User (); View Current user discovery is Dber. show databases; Use Xxxdatabase; SELECT * from Xxxtable; It's running smoothly, OH.

MySQL has a variety of data engines to choose from, ISAM, MyISAM, HEAP, InnoDB, and Berkley (BDB)--and the ability to use mysql++ to create your own database engine--for different scenarios, you can specify different data engines for different tables, For example, the need to use the Transaction processing table set to InnoDB, the other set to MyISAM, as far as possible to improve query performance.

The recording state of VI is the record key state. When you hit Q without a colon in normal mode (command mode), you enter this state. After pressing Q, the first letter or number you press is the shortcut key for this key macro. You can perform the key macro you just edited by pressing @ and the first letter or number you recorded. Enter record status (recording) do not panic, press ESC, and then press Q, you can exit recording. : Wq mandatory Write file and exit (save and exit Write%quite). Force write even if the file is not modified, and update the file's modification time. : X writes the file and exits. Writes only when the file is modified and updates the file modification time, otherwise the file modification time is not updated.

Another friend knows, in text mode, what commands to use to connect to WiFi or set up a network connection? Every time you connect to the WiFi switch to the graphical interface, feeling too low!

Other references:

CentOS 6.4 Under compile install MySQL 5.6.14

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

The following can not be seen, and the subject matter of this article, will move out later!

Plug: always thought that there are too many hyperlinks in the page is not good, reduce transmission efficiency, in fact, this is not accurate. This is true under Http1.0, but now it's mostly Http1.1, and on the same domain file request, multiple HTTP requests and responses can be delivered on an HTTP connection, and if connection is set to "close", So the effect is the same as Http1.0. There is a question that has been bothering me: when the service side has not yet returned, the request terminates (such as clicking the Stop button or closing the page to close the browser, etc.), the server should continue to execute the unfinished business logic, but after execution, will return the results? The key is not clear when the request terminates the connection is closed at the same time, there are friends who know please tell, thank you!

Insert: HTTP POST Request message format

Plug:. h file is a declaration file, you can put class declaration and definition;. cpp files are implementation files that can be placed in the definition of a class; A. cpp file should contain a. h file of the same name in the general case.

Plug: Manage Project libraries with NuGet

Insert: Evolution of the method of parameter verification in C #

Linux Learning Note 2_mysql 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.