MYSQL8.0 installation
It is recommended to use the nanny level installation tutorial
Detailed explanation of mysql download package
download deb file
wget https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
Installation package
sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
Install mysql8.0
apt-get update
sudo apt-get install mysql-server
Database directory: /var/lib/mysql/.
Configuration files: /usr/share/mysql-8.0 (commands and configuration files), /etc/mysql (such as my.cnf).
Related commands: /usr/bin (commands such as mysqladmin, mysqldump) and /usr/sbin.
Startup script: /etc/init.d/mysql (directory of startup script file mysql).
Service port query
sudo netstat -anp | grep mysql
MYSQL no password problem
apt-get install mysql-server //安装后无密码问题
use mysql;
select user,plugin from user;
Change root to local mysql password
update user set plugin= 'mysql_native_password' where user= 'root';
select user,plugin from user;
flush privileges;
Then change the password normally
Just restart the service
MYSQL password error
View password policy deployment
SHOW VARIABLES LIKE 'validate_password%';
Modify password strength
set global validate_password_policy=LOW;
Modify password length
set global validate_password_length=6;
change encryption
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
flush privileges;
1), validate_password_length is the total length of the fixed password;
2), validate_password_dictionary_file specifies the file path for password verification;
3), validate_password_mixed_case_count the entire password must contain at least the total number of uppercase/lowercase letters;
4), validate_password_number_count the entire password must contain at least The number of Arabic numerals;
5), validate_password_policy specifies the strength verification level of the password, the default is MEDIUM;
about the value of validate_password_policy:
Mysql cannot use the show command 1449 error code
1. Delete the problematic user
DROP USER 'mysql.infoschema'@'localhost';
2. Create a user
3. Authorization
CREATE USER 'mysql.infoschema'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT ON *.* TO `mysql.infoschema`@`localhost`;
uninstall mysql
sudo apt purge mysql-*
sudo rm -rf /etc/mysql/ /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
Example of running a jar package in the background
nohup java -jar jar包 &
nohup java -jar server-0.0.1-SNAPSHOT.jar >log.log &
Linux configuration jdk
1. Go to the jdk official website to download the desired version
2. Move to the /usr directory
cd /usr
mkdir java
mv 你的下载tar包路径 /usr/java/
3. The decompression command is tar -zxvf package name
vim /etc/profile
export JAVA_HOME=/usr/java/jdk-17.0.4
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/lib
source /etc/profile just fine
SSH server configuration
vim /etc/ssh/sshd_config
Change a line of code
PermitRootLogin yes
Use ssh username@ip to connect after service sshd restart or use xshell
Linux deployment
netstat -ntpl //You can view the currently used listening port, if there is a port used by the project, you need to kill it first, otherwise it will conflict kill
pid //Kill the process
//Put the war package in a dir, and then execute Just follow the command.
nohup java -jar data.war &
Solve the problem that the source needs to take effect every time you open linux
vim ~/.bashrc
#添加source /etc/profile
source /etc/profile
Resource reference: