centos7 mariadb ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)

来源:互联网 发布:通达信炒股软件编程 编辑:程序博客网 时间:2024/06/07 04:05

现在情况是这样的,将备份的数据导入到数据库里面,插入数据库是用的是mysql,操作系统是centos6.5,而备份的数据往数据库插用的是mariadb,操作系统是centos7。在centos7出现各种问题,有时候新不一定是最好的。

安装mariadb是默认的,打开命令行窗口,直接输入mysql,就可以。之前没有注意到root下的磁盘空间,插到一半,空间满了,可能数据太大了,40多个G。满了,把之前默认数据路径ibdata1,移动到空间更大的地方。移完后,就各种问题,其中权限问题,纠结了一上午。
最上面的问题:往数据库里导数据 指令是:mysql bigdata < /home/data/backdata8.sql 出现了 ERROR 1045 (28000): Access denied for user root@localhost (using password: NO),
最终解决方法,添加一个新的用户就可以了,不用设置密码。–skip-grant-tables 跳过表权限。

今天早上又出现同样的问题,修改密码,之前是默认安装mariadb,是没有密码的。修改

[root@localhost /]# mysql_secure_installation/usr/bin/mysql_secure_installation:行379: find_mysql_client: 未找到命令NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the currentpassword for the root user.  If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)下面是修改成功后,又重新敲了这条指令--skip-grant-tables 跳过表权限,就可以了,查看的日志文件150321 10:20:56 [Warning] IP address '10.10.108.120' could not be resolved: Name or service not known150321 10:23:36 mysqld_safe A mysqld process already exists150321 10:23:44 mysqld_safe A mysqld process already exists150321 10:24:11 [Note] /usr/libexec/mysqld: Normal shutdown150321 10:24:11  InnoDB: Starting shutdown...150321 10:24:12  InnoDB: Shutdown completed; log sequence number 67596365091150321 10:24:12 [Note] /usr/libexec/mysqld: Shutdown complete150321 10:24:12 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended150321 10:24:17 mysqld_safe Starting mysqld daemon with databases from /home/data/150321 10:24:17 InnoDB: The InnoDB memory heap is disabled150321 10:24:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins150321 10:24:17 InnoDB: Compressed tables use zlib 1.2.7150321 10:24:17 InnoDB: Using Linux native AIO150321 10:24:17 InnoDB: Initializing buffer pool, size = 128.0M150321 10:24:17 InnoDB: Completed initialization of buffer pool150321 10:24:17 InnoDB: highest supported file format is Barracuda.150321 10:24:17  InnoDB: Waiting for the background threads to start150321 10:24:18 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 67596365091150321 10:24:18 [Note] Plugin 'FEEDBACK' is disabled.150321 10:24:18 [Note] Server socket created on IP: '0.0.0.0'.150321 10:24:18 [Note] /usr/libexec/mysqld: ready for connections.Version: '5.5.41-MariaDB'  socket: '/home/data/mysql/mysql.sock'  port: 3306  MariaDB Server150321 10:27:40 [Note] /usr/libexec/mysqld: Normal shutdown150321 10:27:40  InnoDB: Starting shutdown...150321 10:27:41  InnoDB: Shutdown completed; log sequence number 67596365091150321 10:27:41 [Note] /usr/libexec/mysqld: Shutdown complete150321 10:27:41 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended150321 10:27:53 mysqld_safe Starting mysqld daemon with databases from /home/data/150321 10:27:53 InnoDB: The InnoDB memory heap is disabled150321 10:27:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins150321 10:27:53 InnoDB: Compressed tables use zlib 1.2.7150321 10:27:53 InnoDB: Using Linux native AIO150321 10:27:53 InnoDB: Initializing buffer pool, size = 128.0M150321 10:27:53 InnoDB: Completed initialization of buffer pool150321 10:27:53 InnoDB: highest supported file format is Barracuda.150321 10:27:53  InnoDB: Waiting for the background threads to start150321 10:27:54 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 67596365091150321 10:27:54 [Note] Plugin 'FEEDBACK' is disabled.150321 10:27:54 [Note] Server socket created on IP: '0.0.0.0'.150321 10:27:54 [Note] /usr/libexec/mysqld: ready for connections.Version: '5.5.41-MariaDB'  socket: '/home/data/mysql/mysql.sock'  port: 3306  MariaDB Server
0 0
原创粉丝点击