MySQL的分区表功能自5.1才开始支持,Centos的MySQL为5.0的,需要将其卸载后安装5.1
MySQL的分区表功能自5.1才开始支持,CentOS的MySQL为5.0的,需要将其卸载后安装5.1
下面是一些操作、错误和解决方案的记录:
1.关闭目前的mysql服务
/etc/init.d/mysqld stop
2.确保已正常关闭
ps -ef | grep mysql
如果没关闭,kill之
3. 查询mysql的安装情况:
rpm -qa | grep mysql
将列出来的删除。
rpm -e mysql-server.x86_64
如果报有多个,则用项 --allmatches将其全部删掉
4. 下载mysql5.5的rpm版
rpm -ivh mysql-server和client
5. 启动新的mysql
/etc/init.d/mysql start
6. 尝试访问
mysql -uroot -p
我的 默认无密码,可正常访问
7.但是之前的php应用没法用了,报cannot load mysql extension .please check your php configuration
原因是刚才把php-mysql删了,其实是不应该删的。
8.重新安装php-mysql,我的系统为centos5.3,php为5.1.依赖的php-mysql也为5.1.yum安装php-mysql报:
libmysqlclient.so.15()(64bit) is needed
libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed
php-common is needed
libmysqlclient.so是包含在mysql-share的,但直接安装5.5版的mysql-share是不行的,因为该版本的没有libmysqlclient.so.15,都高于15.
需要到#downloads下载(MySQL-shared-compat-5.1.62-1.rhel5.i386.rpm)
然后安装,但因为我支持装了5.5的mysql-share,会报冲突,即rpm安装时无法覆盖之前的,使用项--force强制覆盖即可。
rpm -ivh php-common-VERSION php-mysql-VERSION安装成功, 解决该问题
9.在为其他节点远程访问该服务器的数据库设置时出错,Access denied for user 'root'@'localhost'。解决方案见:
,即:
MySQL节点执行GRANT命令为SPIDER服务器进行授权时,,发生了如下错误:
mysql> GRANT ALL ON *.* TO 'spider'@'spiderdb' IDENTIFIED BY 'spider';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
可是我就是使用root用户登录的,root的password也是空的,怎么可能会发生这个错误呢。
网上有相同的错误,是登录不进MySQL的解决办法。如果是忘记了密码,可以用下边的方法:
# /etc/init.d/mysql stop
# mysqld_safe -u mysql --skip-grant-tables --skip-networking &
# mysql -u mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword')where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> exit
# /etc/init.d/mysqld restart
# mysql -uroot -pnewpassword
可是这个方法却解决不了我的问题。
网上还有一种办法,删除user.user中值为NULL的(delete from user where user is NULL),或更新NULL为test(update user set user=‘test‘ where user is NULL)。但是也不好使。
偶然发现对于单个DB的授权是没有问题的,难道是root没有特定DB的权限?写了个script对于每个database执行"GRANT ALL ON $DATABASE.* TO 'root'@'localhost' IDENTIFIED BY 'cps-pt' with grant option;",居然是information_schema的时候出错了。
前两天同志执行dump/restore的时候,DB曾经死掉过,难道information_schema被破坏掉了。
这好像是MySQL的一个restore时的bug。

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


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

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool