mamp:https://www.jianshu.com/p/9de52bf4fc47
php 学习:https://wowphp.com/square
数据库安装目录:Applications/MAMP/db/mysql57
数据库管理:http://localhost/phpmyadmin/
phpstorm 激活:https://blog.csdn.net/voke_/article/details/78794567
mysql:
这里用的 mysql 管理器是:Sequel Pro
数据库文件:/Library/Application Support/appsolute/MAMP PRO/db/mysql/
Connect via network:
$user = 'root';
$password = 'root';
$db = 'inventory';
$host = 'localhost';
$port = 3306;
$link = mysqli_init();
$success = mysqli_real_connect(
$link,
$host,
$user,
$password,
$db,
$port
);
Connect using an UNIX socket:
$user = 'root';
$password = 'root';
$db = 'inventory';
$host = '127.0.0.1';
$port = 3306;
$socket = 'localhost:/Applications/MAMP/tmp/mysql/mysql.sock';
$link = mysqli_init();
$success = mysqli_real_connect(
$link,
$host,
$user,
$password,
$db,
$port,
$socket
);
网友评论