`
zhaohaolin
  • 浏览: 983677 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Linux下MySql出现#1036 - Table ' user' is read only 错误解决方法(转)

 
阅读更多

前几天网站备案被注销了,只有暂时迁移到国外再做打算,换了两台VPS,第一台用服务商配置好的环境+Kloxo管理平台,可能内存少点,或者我哪里没有设置好,导致用不到几个小时就访问不了,又得重启VPS才行,所以前两天会出现偶尔访问不了博客的情况。

      今天刚把第二台VPS的环境配置好,网站迁移过来,在美国洛杉矶机房。现在这台的vps内存稍大点,应该可以确保平稳运行了,速度也勉强可以。

      这次博客搬家出现了点小情况,不过还是顺利解决了。

      这次网站搬家采用直接打包mysql数据库和网页文件的形式进行迁移,上传好mysql data目录里面的网站数据库至VPS上mysql存放数据库的目录里面,解压就行。我的VPS存放数据库的路径是 /usr/local/mysql/var。

      上传好网站数据,解压,配置好数据库链接参数就行,网站就能正常连接上了,我本以为这已经是顺利迁移完成了,但后来操作的时候,发现只能读取数据库的内容,不能更改写入任何信息,提示#1036 - Table '* ' is read only (*号为任意表),也就是说表只有只读属性。

      通过SSH,给数据库文件777权限,dedeadmin是我的数据库文件夹

chmod -R 0777 /usr/local/mysql/var/dedeadmin/

      给数据库目录的所属用户和组改为MySQL
    
chown -R mysql:mysql dedeadmin

      但是这样还不能更改数据库,首先,找到mysqladmin所在位置,一般都在mysql/bin下面,我的在/usr/local/mysql/bin 里面,还需要运行以下命令:

./mysqladmin -u root -p flush-tables

      之后输入root账号的密码,马上就好了,没有任何任何提示,然后测试一下,能正常读写,搬家也就顺利完成。

分享到:
评论

相关推荐

    MySQL优化表时提示 Table is already up to date的解决方法

    在后台使用phpMyAdmin对数据库进行优化时,显示成“Table is already up to date”。 很多人可能会对这次感到担心,因为默认优化表后提示是“status OK”,如下: Table Op Msg_type Msg_text commentmeta optimize ...

    mysql数据库my.cnf配置文件

    #--- 表示MySQL的管理用户 port = 3306 #--- 端口 #basedir=/usr/local/mysql socket=/home/mysql/data/mysql.sock #-- 启动的sock文件 datadir=/home/mysql/data log-bin=/home/mysql/mysql-bin log-error=/home/...

    [php]mysql数据库操作——DB类

    else $this->conn=mysql_connect($this->host,$this->user,$this- >pass); // 临时链接 if (!$this->conn) $this->show_error('无法连接服务器'); $this->select_db($this->data); $this->query('SET NAMES '.$...

    Devart dbForge Studio for MySQL Professional Edition v7.1.13

    dbForge Studio for MySQL is a universal GUI for managing, developing and administrating MySQL and MariaDB databases. The tool allows to create and execute queries, develop and debug routines, automate...

    mysql数据库的基本操作语法

    但是创建table的时候没有任何错误或警告。 Ø 索引 索引是存放在模式(schema)中的一个数据库对象,索引的作用就是提高对表的检索查询速度, 索引是通过快速访问的方法来进行快速定位数据,从而减少了对磁盘的...

    php.ini-development

    Default is ".user.ini" ;user_ini.filename = ".user.ini" ; To disable this feature set this option to empty value ;user_ini.filename = ; TTL for user-defined php.ini files (time-to-live) in seconds....

    Yii+MYSQL锁表防止并发情况下重复数据的方法

    本文实例讲述了Yii+MYSQL锁表防止并发情况下重复数据的方法。分享给大家供大家参考,具体如下: lock table 读锁定 如果一个线程获得在一个表上的read锁,那么该线程和所有其他线程只能从表中读数据,不能进行任何写...

    Linux操作系统基础教程

    Linux 操作系统基础教程 清华大学信息学院计算机系 ...从网上下载的,但是我不推荐易用这种方法得到 Linux,因为仅仅核心就有几十个 Mbit 的 数据量,而一个完整的发行版本大概都是 1Gbit 左右的数据量...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

    处理session跨域几种方案

    // is a session with this id in the database? $res = @mysql_query("SELECT * FROM ".self::db_table." WHERE session_id = '$sessID'", $this->db_handle); // if yes, if(@mysql_num_rows($res)) { ...

    2009达内SQL学习笔记

    如:select table_name from user_tables where table_name like 'S\_%' escape'\'; ' 找出“S_“开头的,由于下划线有任意字符的含义,故需另外定义转移符。 但习惯用“\”,为方便其他程序员阅读和检测,一般不...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

    PostgreSQL 号称“世界上最先进的开源数据库“,可以运行在多种平台下,是tb级数据库,而且性能也很好 中大型企业 oracle 甲骨文 获得最高认证级别的ISO标准安全认证,性能最高, 保持开放平台下的TPC-D和TPC-C的...

    Database Processing Fundamentals, Design, and Implementation (12th Edition).rar

    Designing Read-Only Databases Denormalization Customized Duplicated Tables Common Design Problems The Multivalue, Multicolumn Problem Inconsistent Values Missing Values The General-Purpose Remarks ...

    Delphi7.1 Update

    and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized ...

    Raspberry Pi Zero Cookbook

    In his spare time, he is an Internet of Things enthusiast and has spoken on the wonders of the Raspberry Pi at conferences and user groups. He loves his Raspberry Pis. He has also built his own 3D ...

    PHP基础教程 是一个比较有价值的PHP新手教程!

    解决方法就是将经常用来编写CGI程序的语言的解释器编译进你的web服务器(比如mod_perl,JSP)。PHP就可以以这种方式安装,虽然很少有人愿意这样以CGI方式安装它。内嵌的PHP可以具有更高的可伸缩性。 - 更多特点 PHP的...

    WordPress Top Plugins.pdf

    Table of Contents Preface 1 Chapter 1: Plugin Basics 5 Safety first 6 Automatic install versus manual install 6 Automatic plugin installation 6 Plugin detail 8 Downloading, unpacking, installing...

    sphinx 参考手册和源程序

    2.4. 已知的问题和解决方法 2.5. Sphinx 快速入门教程 3. 建立索引 3.1. 数据源 3.2. 属性 3.3. 多值属性 ( MVA : multi-valued attributes) 3.4. 索引 3.5. 数据源的限制 3.6. 字符集 , 大小写转换 , 和...

    jsp探针 ver0.1

    * 获得windows下指定地址硬盘空间大小 * * @param dirPath * @return */ final private long getDiskForWindowsInfo(String dirPath) { try { long space = -1; Process process; Runtime run = Runtime.getRuntime...

    php_6_fast_and_easy_web_development.pdf

    Installing MySQL for Linux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Testing Your MySQL Installation. . . . . . . . . . . . . . . . . . . . . . . . . 20 Chapter 2 Installing ...

Global site tag (gtag.js) - Google Analytics