mysql_tips
00 [email protected] mac本地使用
1.安装后的使用说明
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have [email protected] first in your PATH, run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
For pkg-config to find [email protected] you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
To start [email protected]:
brew services start [email protected]
Or, if you don't want/need a background service you can just run:
/usr/local/opt/[email protected]/bin/mysqld_safe --datadir=/usr/local/var/mysql
2. mac下的配置文件
查看使用的哪个配置文件:mysql --verbose --help | grep my.cnf
比如mac上的配置文件在:/usr/local/etc/my.cnf
01 mysql的text长度
mysql有4中text类型
| 类型 | 字节数 | 备注 |
|---|---|---|
| tinytext | 256 bytes | |
| text | 65535 bytes | ~64Kb |
| Mediumtext | 16777215 bytes | ~16MB |
| LongText | 4,294,967,295 bytes | ~4GB |