Linux下MySQL出现#1036 – Table ‘ ‘ is read only 错误解决方法
我遇到的问题是:在navicat mysql中从一台mysql服务器(正式)上传输数据到另外一台服务器(模拟数据库)。是整库传输。将模拟数
我遇到的问题是:在navicat mysql中从一台mysql服务器(正式)上传输数据到另外一台服务器(模拟数据库)。是整库传输。将模拟数据库中某一个库的数据文件夹重命名之后,重新创建一个新的数据库,再进行数据传输。传输完成之后,发现模拟上新建的数据库的表变为了只读。 通过按照下面文章的类似步骤,解决了问题。
这两天在进行网站搬家,这次网站搬家采用直接打包mysql数据库和网页文件的形式进行迁移,上传好mysql data目录里面的网站数据库至VPS上mysql存放数据库的目录里面,解压就行。我的VPS存放数据库的路径是 /usr/local/mysql/var。
上传好网站数据,解压,配置好数据库链接参数就行,网站就能正常连接上了,我本以为这已 经是顺利迁移完成了,但后来操作的时候,发现只能读取数据库的内容,不能更改写入任何信息,提示#1036 – Table ‘* ‘ is read only (*号为任意表),也就是说表只有只读属性。
通过SSH,给数据库文件777权限,admin是我的数据库文件夹
第一步: chmod -R 0777 /usr/local/mysql/var/admin/
给数据库目录的所属用户和组改为MySQL
1 第二步: chown -R mysql:mysql admin
但是这样还不能更改数据库,首先,找到mysqladmin所在位置,一般都在mysql/bin下面,,我的在/usr/local/mysql/bin 里面,还需要运行以下命令:
1 第三步: ./mysqladmin -u root -p flush-tables
之后输入root账号的密码,马上就好了,没有任何任何提示,然后测试一下,能正常读写,搬家也就顺利完成。
本文永久更新链接地址:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to deal with MySQL connection error 1049? MySQL is a commonly used relational database management system. Many developers and system administrators use MySQL to store and manage data. However, when using MySQL, sometimes you encounter the problem of connection error 1049. This article will introduce the causes of connection error 1049 and give several methods to solve this problem. MySQL connection error 1049 is usually caused by the database not existing or the database name being wrong. When connecting to the MySQL service

Title: Unknowncolumn'column_name'in'fieldlist'-How to solve MySQL error: Unknown column in field list, specific code examples are needed. When using the MySQL database for query or operation, sometimes you will encounter such error message: "Unknowncolumn' column_name'in'fieldlist'", that is, an unknown column error exists in the field list. This is usually

To resolve the MySQL database initialization failure issue, follow these steps: Check permissions and make sure you are using a user with appropriate permissions. If the database already exists, delete it or choose a different name. If the table already exists, delete it or choose a different name. Check the SQL statement for syntax errors. Confirm that the MySQL server is running and connectable. Verify that you are using the correct port number. Check the MySQL log file or Error Code Finder for details of other errors.

How to deal with MySQL connection error 1017? MySQL is an open source relational database management system that is widely used in website development and data storage. However, when using MySQL, you may encounter a variety of errors. One of the common errors is connection error 1017 (MySQL error code 1017). Connection error 1017 indicates a database connection failure, usually caused by an incorrect username or password. When MySQL fails to authenticate using the provided username and password

This article will explain in detail the numerical encoding of the error message returned by PHP in the previous Mysql operation. The editor thinks it is quite practical, so I share it with you as a reference. I hope you can gain something after reading this article. . Using PHP to return MySQL error information Numeric Encoding Introduction When processing mysql queries, you may encounter errors. In order to handle these errors effectively, it is crucial to understand the numerical encoding of error messages. This article will guide you to use php to obtain the numerical encoding of Mysql error messages. Method of obtaining the numerical encoding of error information 1. mysqli_errno() The mysqli_errno() function returns the most recent error number of the current MySQL connection. The syntax is as follows: $erro

MySQL is a very commonly used open source relational database management system. It has the characteristics of stability, efficiency, flexibility, etc., and is widely used in various types of applications. When using MySQL, you will inevitably encounter database recovery operations. How to accurately check the progress of MySQL database recovery has become a more important issue. The recovery progress of the MySQL database can be obtained by viewing the MySQL error log. In the MySQL error log, all database operation records will be recorded.

During development, if you often deal with MySQL, you will encounter some common errors. Some errors will cause MySQL to not work properly, and some will affect the performance of the program. Here are some common MySQL errors and their solutions. MySQL server cannot connect. When connecting to the MySQL server, you may encounter the following error: Can'tconnecttoMySQLserveron'localhost'(10061)Ac

Solution: 1. Check the data types to ensure that the data types in the columns you create or modify the index are compatible; 2. Avoid using functions or expressions on the columns where you create the index; 3. Use explicit type conversion. If you must use functions or expressions on indexed columns, make sure you use explicit type conversion. 4. Check the MySQL version and documentation to learn more about indexes and data types. 5. Optimize queries , consider re-evaluating and optimizing your queries to ensure effective use of indexes; 6. Consider using other tools or methods, etc.
