Linux stepped pit recording, revel update

Linux stepped pit recording, revel update

Shannon really, is human nature, I was a front-end earners, that without touching Linux, so did the training organized by the school day went on, the results of the virtual machine on for a long time, and finally even months vimare not open, so I will not go on, to continue to learn vue, until now made a full stack project, would like to upload to the cloud Ali, only to find to use linux, of course, can choose window system, but the spirit of learning for the purpose, chose linuxthe system.

This article is fully applicable to the novice, and not the special school linux, the following are effective pro-test content.

Ali cloud CentOS7 installation node environment

note

  1. Please do not apply when selecting Ali cloud image, please do not choose nodejs the mirror, because it is too low version, I had also used this image, the result that comes, you can use the command node, the result is not, so follow the tutorial is installed node, obviously v11.0.0version, version of the results after the installation is v4.
  2. Please use the download binary file, so do not compile, otherwise I might have to install gcc, Node version is too high, but also to upgrade gcc, but also troublesome.
  3. Do not fully installed node method in accordance with the rookie tutorial of CentOS, because the downloaded file needs to be compiled.
  4. Do exactly as rookie tutorial of linuxhow to install a node, which is a soft link is set some of the problems, and the path after Ali cloud node extracting different.

Installation node step

I use the remote connection aliyun official website, there is no tool to download any remote connection, and a black box will appear after remote connection, you can enter the command line.

The following are pro-test effective steps:

  • Switch User
sudo su root
  • Download the binary file to 12.16.1 version, for example

If you want to download another version, on their own to find http://nodejs.org/dist/, pay attention to the suffix, it is to belinux-x64.tar.xz

wget http://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz 
  • Decompression
tar xf  node-v12.16.1-linux-x64.tar.xz      
  • Move Folder

mv 源文件 目标路径

Target path, if no folder system to create their own

mv node-v12.16.1-linux-x64 /usr/local/nodejs
  • Open the file with vim configuration environment variable
vim /etc/profile
  • Find the specified location

Find this line of code in the fileexport PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

  • Writing Environment Variables

In the above string of code found before, add the following

export NODE_HOME=/usr/local/nodejs
export PATH=$NODE_HOME/bin:$PATH
  • Exit and save

Press the esckey to enter the command line mode, and then followed by :wq, Enter, so quit vim

  • Compile / etc / profile to validate the configuration
source /etc/profile
  • test
node -v
npm -v

If the output version, the installation node environment proved successful.

If the connection again, the server, node discovery command does not work, do not worry, once again perform source /etc/profileto

Install mysql

note

Reference rookie tutorial, although some command will complain, but you are very lucky, I have to help you fill up the pit.

If you want to use mysql connection node, it is best not to install more than 8.0 version

installation steps

  • Follow the steps rookie tutorial, these four issues is currently not wisdom

Sequentially inputted

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
yum install mysql-server

In execution yum updateafter, will let you determine whether you want to download, choose y

  • Permission settings
chown mysql:mysql -R /var/lib/mysql
  • initialization
mysqld --initialize

I have here an error, the error code is as follows

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-04-24 18:07:59 0 [Note] mysqld (mysqld 5.6.43) starting as process 16404 ...
2019-04-24 18:07:59 16404 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2019-04-24 18:07:59 16404 [ERROR] Aborting

2019-04-24 18:07:59 16404 [Note] Binlog end
2019-04-24 18:07:59 16404 [Note] mysqld: Shutdown complete
  • Resolve initialization error

Open the file with Vim, vim /etc/my.cnf, add the following in [mysqlId] at

explicit_defaults_for_timestamp=true
user=mysql

After the addition is complete, press esc, press :wq, exit and save.

Solution Original: https://www.cnblogs.com/zhangwy1024/p/10764249.html

After you resolve the error, then initialize mysqld --initialize

  • Start mysql
systemctl start mysqld
  • View mysql running state
systemctl status mysqld
  • Mysql check whether the installation was successful
mysqladmin --version

If the output any information to prove that the installation failed, should theoretically impossible, because I am also so installed.

  • Enter mysql
mysql

I am here being given, the following error message

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Solution:

 ps -A|grep -i  mysql

If the output similar to the following information, then kill kill enough

 13284 ?        00:00:00 mysqld_safe
 13422 ?        00:01:33 mysqld
kill 13284
kill 13422

After finished killing input mysql again, if still reported the same mistakes, then enter it again ps -A|grep -i mysql, and so forth until the kill is clean, so you can smoothly into the mysql

Solution Reference: https://www.cnblogs.com/lvhanzhi/p/10483306.html

After entering the mysql input

SHOW DATABASES;

If you have a return similar information to prove that nothing big problem

+----------+
| Database |
+----------+
| mysql    |
| test     |
+----------+

After the password is changed

Enter quit, quit mysql

  • reset Password

Preferably contain letters and numbers, as well as special accord, such as * \ and the like

mysqladmin -u root password "new_password";

Then there will be a warning, but it does not matter, if nothing important if your mysql data

Then re-enter the mysql, as unsuccessful

mysql -u root -p

Enter a password, then enter and found no similar ** appears, this is normal, you can rest assured that input.

Guess you like

Origin www.cnblogs.com/tourey-fatty/p/12551540.html