mysql明明密码没有问题
我初始化mysql数据库,通过初始化密码登陆,修改后就是登陆不了
# 初始化
/usr/taotie/mysql/bin/mysqld --defaults-file=/usr/taotie/mysql/my.cnf --user=taotie-dber --initialize
# 开启服务
mysqld_safe --defaults-file=/etc/my.cnf --user=taotie-dber
# 登录
mysql -uroot -p
#修改密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH sha256_password BY '新密码' PASSWORD EXPIRE INTERVAL 360 DAY;
CREATE USER wp IDENTIFIED BY '新密码';
flush privileges;
之后登陆不了
mysql -uroot -p新密码
贴上数据库/etc/my.cnf配置
[client]
port = 3306
socket = /tmp/mysql.sock
# The MySQL server
[mysqld]
port = 3306
user = taotie-dber
socket = /tmp/mysql.sock
pid-file = /data/miss_taotie_db/mysqld.pid
basedir = /usr/taotie/mysql/
datadir = /data/miss_taotie_db/db
tmpdir = /data/miss_taotie_db/tmp
open_files_limit = 60000
explicit_defaults_for_timestamp=true
server-id = 1203306
lower_case_table_names = 1
character-set-server = utf8mb4
federated
#sql_mode=STRICT_TRANS_TABLES
#sql_mode="NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER"
max_connections = 1000
max_connect_errors = 100000
interactive_timeout = 86400
wait_timeout = 86400
sync_binlog=0
back_log=100
default-storage-engine = InnoDB
log_slave_updates = 1
#skip-grant-tables
#default-authentication-plugin=sha256_password
default-authentication-plugin=mysql_native_password
#default-authentication-plugin=caching-sha2-password
#*********** Logs related settings ***********
log-bin = /data/miss_taotie_db/logs/binlog/mysql-bin
binlog_format= mixed
binlog_cache_size=32m
max_binlog_cache_size=64m
max_binlog_size=512m
long_query_time = 1
log_output = FILE
log-error = /data/miss_taotie_db/logs/mysql-error.log
slow_query_log = 1
slow_query_log_file = /data/miss_taotie_db/logs/slow_statement.log
#log_queries_not_using_indexes
general_log = 0
general_log_file = /data/miss_taotie_db/logs/general/general_statement.log
#expire-logs-days = 14
binlog_expire_logs_seconds = 1728000
relay-log = /data/miss_taotie_db/logs/binlog/relay-bin
relay-log-index = /data/miss_taotie_db/logs/binlog/relay-bin.index
#****** MySQL Replication New Feature*********
master-info-repository=TABLE
relay-log-info-repository=TABLE
relay-log-recovery
#*********** INNODB Specific options ***********
innodb_buffer_pool_size = 4096M
transaction-isolation=REPEATABLE-READ
innodb_buffer_pool_instances = 8
innodb_file_per_table = 1
innodb_data_home_dir = /data/miss_taotie_db/innodb/innodb_ts
innodb_data_file_path = ibdata1:2048M:autoextend
innodb_thread_concurrency = 8
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_log_group_home_dir = /data/miss_taotie_db/innodb/innodb_log
innodb_flush_log_at_trx_commit = 2
innodb_max_dirty_pages_pct = 70
innodb_flush_method=O_DIRECT
[mysql]
no-auto-rehash
default-character-set=utf8mb4
prompt = (\u@\h) [\d]>\_
问题搞定 我之前用随机密码生成器生成的密码,比如 Gx*X@%$mQdizFutu 或者 $oRU-fBNHmimMtzi 设置成功,但是无法登陆 但是我后来放弃随机密码生成器 比如 1111 这样的密码,登陆成功
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论