cd /usr/local/mysql/support-files
cp mysql.server /etc/init.d/mysql
################### 修改目录位置#将/etc/init.d/mysql文件中的basedir和datadir路径按如下修改# basedir=/usr/local/mysql# datadir=/data/mysql/data#vim /etc/init.d/mysql
################### 注册开机启动服务[root@wanwan support-files]# chkconfig --add mysql[root@wanwan support-files]# chkconfig --list################### 添加环境变量[root@wanwan support-files]# echo "PATH=$PATH:/usr/local/mysql/bin " >> /etc/profile [root@wanwan support-files]# source /etc/profile################### 初始化mysql[root@wanwan support-files]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data################### 获取临时密码[root@wanwan support-files]# more /data/mysql/logs/error.log |grep password2022-04-19T12:04:23.659001-05:00 1[Note] A temporary password is generated for root@localhost: 7Sc<hW2UQs&V
################### 启动mysql[root@wanwan support-files]# service mysql start
Starting MySQL. [ OK ]################### 登录mysql[root@wanwan support-files]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.36-log
Copyright (c)2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
################### 修改mysql的root用户密码为root
mysql> alter user 'root'@'localhost' identified by 'root';
Query OK, 0 rows affected (0.00 sec)################### 刷新用户密码权限
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
################### 创建软连接[root@wanwan bin]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql################### 重启mysql服务[root@wanwan bin]# service mysql restart################### 重新验证登录mysql用户[root@wanwan bin]# mysql -u root -p
问题一:ERROR 1114 (HY000) at line 10692: The table ‘t_user’ is full
################### 问题一:执行mysql导入时,由于表数据过多报错;[root@wanwan mysql]# mysql -uroot -proot < full_20220420.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1114(HY000) at line 10692: The table 't_user' is full
[root@wanwan mysql]# ################### 解决方法,打开mysql配置文件,修改如下2个配置,然后执行service mysql restart 重启mysql服务,再重新导入vim /etc/my.cnf
tmp_table_size = 256M
max_heap_table_size = 256M