安装MySQL压缩包,然后拖到服务器文件
1. 下载MySQL安装包
MYSQL官方网站:点我点我
点击DOWNLOAD
找到 MySQL Community (GPL) Downloads »
点进去之后 点击MySQL Community Server(当然你也可以直接点这个…(:з」∠))
Select Operating System: 选择所需要安装mysql的系统(根据自己的云服务器系统)
下载Linux - Generic (glibc 2.12) (x86, 64-bit), Compressed TAR Archive的安装包(我是Centos)
也可以自己手动下载!!!! 选择 Archives
2. 使用FileZilla Client软件传输MySQL安装包
下载完是个安装包,放到云服务器 home/mysql下(建议使用FileZilla Client软件进行传输,传输较慢根据网速决定,我传输预计18分钟…)
等待传输完成 =-=
云端初始化MySQL
如果Error ---- 注意看我终端[root@20230321-instance ~]路径
1. 创建mysql用户和mysql用户组
[root@20230321-instance ~]# groupadd mysql [root@20230321-instance ~]# useradd -g mysql mysql (一般不会用,最高用户为root) [root@20230321-instance ~]# passwd root (直接设置root密码,一般密码就是云服务器密码,也用不到改) 注意一下,密码输入是隐式输入,不会显示,你直接输完然后回车就行 Changing password for user mysql. New password: 请输入你的密码 Retype new password:请再次输入你的密码 passwd: all authentication tokens updated successfully. --> 出这个就是成功
2. 解压mysql压缩包到/usr/loacl/mysql目录
[root@20230321-instance /]# tar -zxvf home/mysql/mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
接下来如果出一堆mysql文件,不报错就算成功, 比如:
mysql-5.7.27-linux-glibc2.12-x86_64/bin/myisam_ftdump mysql-5.7.27-linux-glibc2.12-x86_64/bin/myisamchk mysql-5.7.27-linux-glibc2.12-x86_64/bin/myisamlog mysql-5.7.27-linux-glibc2.12-x86_64/bin/myisampack mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_client_test_embedded mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_config_editor mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_embedded mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_install_db mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_plugin mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_secure_installation mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_ssl_rsa_setup mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_tzinfo_to_sql mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_upgrade mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqladmin mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlbinlog mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlcheck mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqldump mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlimport mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlpump mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlshow mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlslap mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqltest_embedded mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqlxtest mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqld-debug mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqld-debug.a mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysql_config mysql-5.7.27-linux-glibc2.12-x86_64/include/big_endian.h mysql-5.7.27-linux-glibc2.12-x86_64/include/binary_log_types.h mysql-5.7.27-linux-glibc2.12-x86_64/include/byte_order_generic.h mysql-5.7.27-linux-glibc2.12-x86_64/include/byte_order_generic_x86.h mysql-5.7.27-linux-glibc2.12-x86_64/include/decimal.h mysql-5.7.27-linux-glibc2.12-x86_64/include/errmsg.h mysql-5.7.27-linux-glibc2.12-x86_64/include/keycache.h mysql-5.7.27-linux-glibc2.12-x86_64/include/little_endian.h mysql-5.7.27-linux-glibc2.12-x86_64/include/m_ctype.h mysql-5.7.27-linux-glibc2.12-x86_64/include/m_string.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_alloc.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_byteorder.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_command.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_compiler.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_config.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_dbug.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_dir.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_getopt.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_global.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_list.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_sys.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_thread.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_thread_local.h mysql-5.7.27-linux-glibc2.12-x86_64/include/my_xml.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/client_authentication.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/client_plugin.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/client_plugin.h.pp mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/com_data.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/get_password.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/group_replication_priv.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/innodb_priv.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/mysql_lex_string.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_audit.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_audit.h.pp mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_auth.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_auth.h.pp mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_auth_common.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_ftparser.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_ftparser.h.pp mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_group_replication.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_keyring.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_keyring.h.pp mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_trace.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/plugin_validate_password.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_file.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_idle.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_mdl.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_memory.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_ps.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_socket.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_sp.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_stage.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_statement.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_table.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_thread.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/mysql_transaction.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/psi.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/psi_base.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/psi/psi_memory.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_command.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_locking.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_my_plugin_log.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_my_snprintf.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_mysql_alloc.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_mysql_keyring.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_mysql_password_policy.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_mysql_string.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_parser.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_rpl_transaction_ctx.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_rpl_transaction_write_set.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_rules_table.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_security_context.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_srv_session.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_srv_session_info.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_ssl_wrapper.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_thd_alloc.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_thd_engine_lock.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_thd_wait.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/service_thread_scheduler.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/services.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/services.h.pp mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/thread_pool_priv.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql/thread_type.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql_com.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql_com_server.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql_embed.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql_time.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysql_version.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysqld_ername.h mysql-5.7.27-linux-glibc2.12-x86_64/include/mysqld_error.h mysql-5.7.27-linux-glibc2.12-x86_64/include/plugin.h mysql-5.7.27-linux-glibc2.12-x86_64/include/plugin_audit.h mysql-5.7.27-linux-glibc2.12-x86_64/include/plugin_ftparser.h mysql-5.7.27-linux-glibc2.12-x86_64/include/plugin_group_replication.h mysql-5.7.27-linux-glibc2.12-x86_64/include/plugin_keyring.h mysql-5.7.27-linux-glibc2.12-x86_64/include/plugin_validate_password.h mysql-5.7.27-linux-glibc2.12-x86_64/include/sql_common.h mysql-5.7.27-linux-glibc2.12-x86_64/include/sql_state.h mysql-5.7.27-linux-glibc2.12-x86_64/include/sslopt-case.h mysql-5.7.27-linux-glibc2.12-x86_64/include/sslopt-longopts.h mysql-5.7.27-linux-glibc2.12-x86_64/include/sslopt-vars.h mysql-5.7.27-linux-glibc2.12-x86_64/include/thr_cond.h mysql-5.7.27-linux-glibc2.12-x86_64/include/thr_mutex.h mysql-5.7.27-linux-glibc2.12-x86_64/include/thr_rwlock.h mysql-5.7.27-linux-glibc2.12-x86_64/include/typelib.h mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqlclient.a mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqlservices.a mysql-5.7.27-linux-glibc2.12-x86_64/lib/pkgconfig/mysqlclient.pc mysql-5.7.27-linux-glibc2.12-x86_64/share/aclocal/mysql.m4 mysql-5.7.27-linux-glibc2.12-x86_64/docs/ChangeLog mysql-5.7.27-linux-glibc2.12-x86_64/docs/INFO_SRC mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqld.a mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/comp_err.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/innochecksum.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/lz4_decompress.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/my_print_defaults.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/myisam_ftdump.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/myisamchk.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/myisamlog.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/myisampack.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql.server.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_config.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_config_editor.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_install_db.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_plugin.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_secure_installation.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_ssl_rsa_setup.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_tzinfo_to_sql.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysql_upgrade.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqladmin.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlbinlog.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlcheck.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqld_multi.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqld_safe.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqldump.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqldumpslow.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlimport.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlman.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlpump.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlshow.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/mysqlslap.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/perror.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/replace.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/resolve_stack_dump.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/resolveip.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man1/zlib_decompress.1 mysql-5.7.27-linux-glibc2.12-x86_64/man/man8/mysqld.8 mysql-5.7.27-linux-glibc2.12-x86_64/COPYING mysql-5.7.27-linux-glibc2.12-x86_64/README mysql-5.7.27-linux-glibc2.12-x86_64/bin/innochecksum mysql-5.7.27-linux-glibc2.12-x86_64/bin/lz4_decompress mysql-5.7.27-linux-glibc2.12-x86_64/bin/my_print_defaults mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqld mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqld_multi mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqld_safe mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqldumpslow mysql-5.7.27-linux-glibc2.12-x86_64/bin/perror mysql-5.7.27-linux-glibc2.12-x86_64/bin/replace mysql-5.7.27-linux-glibc2.12-x86_64/bin/resolve_stack_dump mysql-5.7.27-linux-glibc2.12-x86_64/bin/resolveip mysql-5.7.27-linux-glibc2.12-x86_64/bin/zlib_decompress mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/char.bin mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/dicrc mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/left-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/matrix.bin mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/pos-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/rewrite.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/right-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/sys.dic mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_euc-jp/unk.dic mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/char.bin mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/dicrc mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/left-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/matrix.bin mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/pos-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/rewrite.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/right-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/sys.dic mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_sjis/unk.dic mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/char.bin mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/dicrc mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/left-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/matrix.bin mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/pos-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/rewrite.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/right-id.def mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/sys.dic mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/dic/ipadic_utf-8/unk.dic mysql-5.7.27-linux-glibc2.12-x86_64/lib/mecab/etc/mecabrc mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/adt_null.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/auth_socket.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/authentication_ldap_sasl_client.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/connection_control.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/adt_null.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/auth_socket.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/authentication_ldap_sasl_client.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/connection_control.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/group_replication.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/ha_example.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/innodb_engine.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/keyring_file.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/keyring_udf.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libmemcached.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libpluginmecab.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_framework.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_services.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_services_threaded.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_session_detach.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_session_in_thd.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_session_info.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_2_sessions.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_all_col_types.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_cmds_1.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_commit.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_complex.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_errors.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_lock.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_processlist.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_replication.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_shutdown.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_sqlmode.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_stored_procedures_functions.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_sql_views_triggers.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_x_sessions_deinit.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/libtest_x_sessions_init.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/locking_service.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/mypluglib.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/mysql_no_login.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/mysqlx.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/rewrite_example.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/rewriter.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/semisync_master.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/semisync_slave.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/test_security_context.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/test_udf_services.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/validate_password.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/debug/version_token.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/group_replication.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/ha_example.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/innodb_engine.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/keyring_file.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/keyring_udf.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libmemcached.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libpluginmecab.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_framework.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_services.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_services_threaded.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_session_detach.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_session_in_thd.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_session_info.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_2_sessions.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_all_col_types.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_cmds_1.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_commit.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_complex.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_errors.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_lock.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_processlist.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_replication.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_shutdown.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_sqlmode.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_stored_procedures_functions.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_sql_views_triggers.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_x_sessions_deinit.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/libtest_x_sessions_init.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/locking_service.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/mypluglib.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/mysql_no_login.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/mysqlx.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/rewrite_example.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/rewriter.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/semisync_master.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/semisync_slave.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/test_security_context.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/test_udf_services.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/validate_password.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/plugin/version_token.so mysql-5.7.27-linux-glibc2.12-x86_64/share/bulgarian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/Index.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/README mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/armscii8.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/ascii.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp1250.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp1251.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp1256.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp1257.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp850.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp852.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/cp866.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/dec8.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/geostd8.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/greek.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/hebrew.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/hp8.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/keybcs2.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/koi8r.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/koi8u.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/latin1.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/latin2.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/latin5.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/latin7.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/macce.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/macroman.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/charsets/swe7.xml mysql-5.7.27-linux-glibc2.12-x86_64/share/czech/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/danish/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/dictionary.txt mysql-5.7.27-linux-glibc2.12-x86_64/share/dutch/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/english/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/errmsg-utf8.txt mysql-5.7.27-linux-glibc2.12-x86_64/share/estonian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/fill_help_tables.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/french/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/german/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/greek/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/hungarian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/innodb_memcached_config.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/italian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/japanese/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/korean/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/mysql_security_commands.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/mysql_sys_schema.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/mysql_system_tables.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/mysql_system_tables_data.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/mysql_test_data_timezone.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/norwegian-ny/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/norwegian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/polish/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/portuguese/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/romanian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/russian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/serbian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/slovak/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/spanish/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/swedish/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/share/ukrainian/errmsg.sys mysql-5.7.27-linux-glibc2.12-x86_64/support-files/mysql-log-rotate mysql-5.7.27-linux-glibc2.12-x86_64/support-files/mysqld_multi.server mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqlclient.so mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqlclient.so.20 mysql-5.7.27-linux-glibc2.12-x86_64/lib/libmysqlclient.so.20.3.14 mysql-5.7.27-linux-glibc2.12-x86_64/share/install_rewriter.sql mysql-5.7.27-linux-glibc2.12-x86_64/share/uninstall_rewriter.sql mysql-5.7.27-linux-glibc2.12-x86_64/support-files/magic mysql-5.7.27-linux-glibc2.12-x86_64/support-files/mysql.server mysql-5.7.27-linux-glibc2.12-x86_64/docs/INFO_BIN mysql-5.7.27-linux-glibc2.12-x86_64/docs/INFO_SRC
放到/usr/local/mysql 下
[root@20230321-instance /]# mv mysql-5.7.27-linux-glibc2.12-x86_64 /usr/local/mysql/
3. 创建目录
[root@20230321-instance /]# cd /usr/local/mysql [root@20230321-instance mysql]# mkdir conf #配置文件目录 [root@20230321-instance mysql]# mkdir data #配置文件目录 [root@20230321-instance mysql]# mkdir ibdata #配置文件目录 [root@20230321-instance mysql]# mkdir redolog #redolog文件目录 [root@20230321-instance mysql]# mkdir -p mysqllog/logfile #redolog文件目录 [root@20230321-instance mysql]# mkdir -p mysqllog/relaylog #relaylog文件目录 [root@20230321-instance mysql]# mkdir -p mysqllog/binlog #binlog文件目录
4. 创建my.cnf配置文件
[root@20230321-instance mysql]# vi /usr/local/mysql/conf/my.cnf 配置文件如下↓ ---------------------------------------------------------------------------------------- [mysqld] server-id=134 port=13306 basedir=/usr/local/mysql datadir=/usr/local/mysql/data socket=/usr/local/mysql/mysql.sock character-set-server=utf8mb4 max_connections = 1500 binlog_format=row log-bin=/usr/local/mysql/mysqllog/binlog slow_query_log_file=/usr/local/mysql/mysqllog/logfile/slow-query.log log-error=/usr/local/mysql/mysqllog/logfile/mysql-err.log relay-log-index=/usr/local/mysql/mysqllog/relaylog/slave-relay-bin.index relay-log=/usr/local/mysql/mysqllog/relaylog/relaylog-binlog gtid_mode=ON enforce_gtid_consistency = ON event_scheduler=1
5. 更改目录权限
[root@20230321-instance bin]# chown -R root:root /usr/local/mysql
6. 初始化数据库
注意注意!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
执行下面代码行命令前…
请先确定好bin文件是哪个bin文件…
不然下载会报↓
注意:
下面这个是错误示范
[root@20230321-instance bin]# ./mysqld --initialize --user=root --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 这是输入后的报错: -bash: ./mysqld: No such file or directory
下面这个操作才是正确的 👇
[root@20230321-instance /]# cd usr/local/mysql/mysql-5.7.27-linux-glibc2.12-x86_64/bin/ ------------------------------------------------------------------------------------------------------------------------------------ 无提示错误可以直接往下看(虚线下面) 敲完上面命令如果提示(错误): ./mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory 1. 这个错误提示意味着在运行 mysqld 命令时,系统无法找到 libaio.so.1 共享库文件。 2.libaio.so.1 文件是 Linux 系统中用于异步 I/O 操作的共享库文件之一。这个库文件通常由多个应用程序使用,因此将其安装在系统范围内可以确保其他应用程序也能够使用它。 3.解决方案:安装 libaio 库 那就下载一个libaio库: sudo yum install libaio ------------------------------------------------------------------------------------------------------------------------------------ 下载完毕 libaio后, 继续输入下面的命令 [root@20230321-instance bin]# ./mysqld --initialize --user=root --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
7. 启动数据–mysql用户执行
[root@20230321-instance ~]# /usr/local/mysql/mysql-5.7.27-linux-glibc2.12-x86_64/bin/mysqld_safe --defaults-file=/usr/local/mysql/conf/my.cnf --user=root &
8. 修改初始化密码–mysql用户执行
不想改可以不改 [root@20230321-instance ~]# mysql -h 127.0.0.1 -uroot -P13306 -S /usr/local/mysql/mysql.sock -p 输入密码:【初始化密码在初始化数据库时,最后一行:2022-05-08T08:52:11.257229Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 7s4vui&_Ew#q】 mysql> alter user 'root'@'localhost' identified by 'mysql'; #修改密码为:mysql
9. 重新登录数据
[root@20230321-instance ~]# mysql -h 127.0.0.1 -uroot -P13306 -S /usr/local/mysql8/mysql.sock -pmysql
10. 至此, MySQL已经安装完毕
如果有报错的话,希望大家可以在评论区说出 欢迎一起讨论错误和bug问题
本套代码摘抄 + 改编自 - https://blog.csdn.net/kande0707/article/details/124651206
感谢无私奉献13年的 kande0707 (:з」∠)
有些细节已标注
————————————————
版权声明:本文为CSDN博主「kande0707」的同人二创文章()