继续<Yii Framework2.0开发教程(3)数据库mysql入门> 首先给予一定的尊重yii2数据库支持引进 Yii 基于 PHP's PDO一个成熟的数据库访问层的建立.它提供了一个统一的 API 并且克服了许多不同的 DBMS 违禁使用. Yii 默认支持下面 DBMS : MySQL MariaDB SQLite PostgreSQL CUBRID: version 9.1.0 or higher. Oracle MSSQL: version 2012 或更高版本号,如需使用 L
每次设置root和远程访问都容易出现问题, 总结了个通用方法, 关键在于实用 step1: # mysql -u root mysql mysql> Grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; //增加远程访问权限mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; //增加ro
一.sql中使用正则表达式 select name,email from user where email Regexp "@163[.,]com$"; sql语句中使用Regexp对性能影响较大. 二.使用Rand()函数获取随机数据 rand();随机数函数 1.随机排序 mysql> select * from hello order by rand(); 2.随机列抽取3条 mysql> select * from hello order by rand() lim