Mysql如何修改密码

[root@localhost ~]# rz
[root@localhost ~]# rpm -ivh MySQL-clinet-5.6.40-1.el6.x86_64.rpm
error: open of MySQL-clinet-5.6.40-1.el6.x86_64.rpm failed: No such file or directory
[root@localhost ~]# rpm -ivh MySQL-client-5.6.40-1.el6.x86_64.rpm
error: open of MySQL-client-5.6.40-1.el6.x86_64.rpm failed: No such file or directory
[root@localhost ~]# rpm -qa |grep mysql
[root@localhost ~]# rz
[root@localhost ~]# rpm -ivh MySQL-client-5.6.40-1.el6.x86_64.rpm
error: open of MySQL-client-5.6.40-1.el6.x86_64.rpm failed: No such file or directory
[root@localhost ~]# rpm -qa |grep mysql
[root@localhost ~]# ls
anaconda-ks.cfg
dir
install.log
install.log.syslog
MySQL-client-5.5.61-1.el6.x86_64.rpm
MySQL-devel-5.5.61-1.el6.x86_64.rpm
MySQL-server-5.5.61-1.el6.x86_64_(1).rpm
MySQL-shared-5.5.61-1.el6.x86_64.rpm
mysqlsla-2.03.tar.tar
one
three
two
xiao
yinnan
[root@localhost ~]# rpm -ivh MySQL-server-5.5.61-1.el6.x86_64_(1).rpm
warning: MySQL-server-5.5.61-1.el6.x86_64_(1).rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing… ########################################### [100%]
1:MySQL-server ########################################### [100%]
warning: user mysql does not exist - using root
warning: group mysql does not exist - using root
190417 7:04:33 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
190417 7:04:33 [Note] /usr/sbin/mysqld (mysqld 5.5.61) starting as process 3921 …
190417 7:04:33 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
190417 7:04:33 [Note] /usr/sbin/mysqld (mysqld 5.5.61) starting as process 3928 …

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

[root@localhost ~]# rpm -ivh MySQL-shared-5.5.61-1.el6.x86_64.rpm
warning: MySQL-shared-5.5.61-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing… ########################################### [100%]
1:MySQL-shared ########################################### [100%]
[root@localhost ~]# rpm -ivh MySQL-devel-5.5.61-1.el6.x86_64.rpm
warning: MySQL-devel-5.5.61-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing… ########################################### [100%]
1:MySQL-devel ########################################### [100%]
[root@localhost ~]# rpm -ivh MySQL-client-5.5.61-1.el6.x86_64.rpm
warning: MySQL-client-5.5.61-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing… ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@localhost ~]# cd /usr/share/mysql
[root@localhost mysql]# ls
binary-configure danish french korean my-small.cnf mysql_test_data_timezone.sql romanian swedish
charsets dutch german magic mysqld_multi.server ndb-config-2-node.ini russian ukrainian
config.huge.ini english greek my-huge.cnf mysql-log-rotate norwegian SELinux
config.medium.ini errmsg-utf8.txt hungarian my-innodb-heavy-4G.cnf mysql.server norwegian-ny serbian
config.small.ini estonian italian my-large.cnf mysql_system_tables_data.sql polish slovak
czech fill_help_tables.sql japanese my-medium.cnf mysql_system_tables.sql portuguese spanish
[root@localhost mysql]# cp my-huge.cnf /etc
[root@localhost mysql]# cd /etc
[root@localhost etc]# ls
abrt crypttab gai.conf kdump-adv-conf NetworkManager prelink.cache rsyslog.d sudo-ldap.conf
acpi csh.cshrc gconf kdump.conf networks prelink.conf rwtab sysconfig
adjtime csh.login gcrypt krb5.conf nsswitch.conf prelink.conf.d rwtab.d sysctl.conf
aliases cups gdm ld.so.cache ntp printcap samba sysctl.d
aliases.db dbus-1 ghostscript ld.so.conf ntp.conf profile sane.d system-release
alsa default gnome-vfs-2.0 ld.so.conf.d obex-data-server profile.d sasl2 system-release-cpe
alternatives depmod.d gnupg libaudit.conf openldap protocols scl terminfo
anacrontab dhcp group libreport opt pulse securetty tpvmlp.conf
asound.conf DIR_COLORS group- libuser.conf PackageKit quotagrpadmins security udev
at.deny DIR_COLORS.256color grub.conf localtime pam.d quotatab selinux updatedb.conf
audisp DIR_COLORS.lightbgcolor gshadow login.defs pango rc services vimrc
audit dnsmasq.conf gshadow- logrotate.conf passwd rc0.d sestatus.conf virc
avahi dnsmasq.d gtk-2.0 logrotate.d passwd- rc1.d setuptool.d vmware-caf
bash_completion.d dracut.conf hal lvm passwd.OLD rc2.d sgml vmware-tools
bashrc dracut.conf.d host.conf magic pbm2ppa.conf rc3.d shadow warnquota.conf
blkid drirc hosts mailcap pcmcia rc4.d shadow- wgetrc
bluetooth enscript.cfg hosts.allow mail.rc pinforc rc5.d shells wpa_supplicant
bonobo-activation environment hosts.deny makedev.d pkcs11 rc6.d skel X11
centos-release ethers hp man.config pki rc.d smartd.conf xdg
chkconfig.d exports httpd mime.types plymouth rc.local sos.conf xinetd.d
ConsoleKit favicon.png init mke2fs.conf pm rc.sysinit sound xml
cron.d festival init.conf modprobe.d pm-utils-hd-apm-restore.conf rdma ssh yum
cron.daily filesystems init.d motd pnm2ppa.conf readahead.conf ssl yum.conf
cron.deny firefox inittab mtab polkit-1 redhat-release statetab yum.repos.d
cron.hourly fonts inputrc mtools.conf popt.d resolv.conf statetab.d
cron.monthly foomatic iproute2 my.cnf.d portreserve rpc sudo.conf
crontab fprintd.conf issue my-huge.cnf postfix rpm sudoers
cron.weekly fstab issue.net nanorc ppp rsyslog.conf sudoers.d
[root@localhost etc]# mv my-huge.cnf my.cnf
[root@localhost etc]# vim my.cnf
[root@localhost etc]# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL.Logging to ‘/var/lib/mysql/localhost.localdomain.err’.
… SUCCESS!
[root@localhost etc]# mysql\

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.61-log MySQL Community Server (GPL)

Copyright © 2000, 2018, Oracle and/or its affiliates. All rights reserved.

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> Ctrl-C – exit!
Aborted
[root@localhost etc]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.61-log MySQL Community Server (GPL)

Copyright © 2000, 2018, Oracle and/or its affiliates. All rights reserved.

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>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值