资源链接: https://pan.baidu.com/s/1Y13mx7uzU__Qc5XDz6z6pQ 密码: i52o
配置环境变量
vi /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_171
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
启动tomcat
cd /usr/local/apache-tomcat-9.0.33/bin/
./startup.sh
小tip:可以在/www创建快捷方式,便于寻找
1. 把文件加压到/usr/local/mysql
2. 创建/usr/local/mysql/data目录
3. 创建mysql用户和组
4. 给权限chown -R mysql:mysql /usr/local/mysql
5.
//初始化5.0
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
//初始化8.0
./bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
6. cp support-files/mysql.server /etc/init.d/mysql
7. chkconfig mysql on
8. service mysql start
问题:
1. Failed to find valid data directory.:
1. 创建my.cnf(文件在下面)和my.cnf.d/
2. vi /etc/profile
3. export PATH=$PATH:/usr/local/mysql/bin
4. source /etc/profile
5. 删除/usr/local/data文件夹
6. mysqld --initialize --console
7. chown -R mysql:mysql /usr/local/mysql
[mysqld]
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
#[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
[client]
port=3306
socket=/usr/local/mysql/mysql.sock
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
//设置初始密码
1. 使用命令: vi /etc/my.cnf
2. 在[mysqld]下添加一段代码: skip-grant-tables
3. 重启mysql服务: service mysql restart
4. 用户无密码登录: mysql -uroot -p
5. 选择mysql数据库: use mysql;
6. 刷新权限: flush privileges;
7.alter user 'root'@'localhost' identified by 'password';
8. update user set host = '%' where user ='root';
9. 退出: exit;
10: 再次进入my.cnf里删除skip-grant-tables
11. 重启mysql服务:service mysql restart
信息加载中,请等待
微信客服(速回)
微信客服(慢回)