Search Posts

Category: mysql

MySQL view database related information

When using MySQL, you need to know the current database, such as the current database size, character set, user, and so on. The following summarizes some commands for viewing database related information. 1: View shows all databases

  2: View the database currently in use

      3: View the database usage port  

    4: View the current database size For example, I want to check the size of […]

mysql accidentally delete root user or no root user – linux

Sometimes installing Mysql in Linux will result in no root user, or the root account will be deleted from the mysql.user table, which will result in many permissions being uncontrollable. Solution Re-create the root user and grant all permissions as follows: 1. Modify the /etc/my.conf file and add skip-grant-tables [mysqld] Datadir=/var/lib/mysql Socket=/var/lib/mysql/mysql.sock User=mysql # Disabling symbolic-links is recommended to prevent assorted security risks Symbolic-links=0 Skip-grant-tables [mysqld_safe] Log-error=/var/log/mysqld.log Pid-file=/var/run/mysqld/mysqld.pid 2, restart the mysql service /etc/init.d/mysqld restart […]

mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

solution centos

 

include or exclude tables with a specific prefix in mysqldump or mysql

I crawled the database, and there were enough tables to die. For example, there are about 200 tables, and about 60 of them have a prefix like piyo_, and there is a desire that I want to execute mysqldump excluding it. For a few tables excluded,–ignore-tableYou can use Because there are multiple–ignore-table=”piyo%”I thought I shouldn’t do it, but I’m sorry. As a result, I was able to manage somehow with the following approach. First of […]

Table is marked as crashed and last (automatic?) repair failed

Steps to repair crashed data: 1. stop mysql 2.run the following command

3.start mysql

mysqldump except tables

 

Next Page »