在department里面放入一个html文件,就可以在浏览器访问了,但是访问的浏览器必须和服务器电脑在同一个网络里面:
4.PHP连接本地MYSQL数据库
;extension=php_mysql.dll
;extension=php_mysqli.dll
官网下载mysql的Mac版本:http://dev.mysql.com/downloads/mysql/
Xinhous-MacBook-Pro:~ username$ mysql -u root -p
另外也可以通过偏好设置里的mysql图标点开进行数据库开启关闭;
2.更改mysql root账户密码
进入mysql后修改root密码:
mysql> set password = password('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)
新密码已经设置为:123
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> create database jxh;
Query OK, 1 row affected (0.03 sec)
删除数据库:
mysql> drop database jxh;
Query OK, 0 rows affected (0.10 sec)
mysql> use mysql;
Database changed
显示mysql数据库中的所有表:
mysql> show tables;
mysql> create table user(uid int(10) not null,username varchar(20) not null,password varchar(20),primary key(uid));
mysql> desc user;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| uid | int(10) | NO | PRI | NULL | |
| username | varchar(20) | NO | | NULL | |
| password | varchar(20) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
3 rows in set (0.04 sec)
重命名表名(‘user’改为‘usertable’):
mysql> rename table user to usertable;
Query OK, 0 rows affected (0.03 sec)
删除表:
mysql> drop table usertable;
Query OK, 0 rows affected (0.03 sec)
向表中插入一条数据:
mysql> insert into user(uid,username,password) values(1,'jxh','123');
Query OK, 1 row affected (0.02 sec)
显示表中所有数据:
mysql> select * from user;
+-----+----------+----------+
| uid | username | password |
+-----+----------+----------+
| 1 | jxh | 123 |
+-----+----------+----------+
1 row in set (0.00 sec)
删除一条数据:
mysql> delete from user where uid=1;
Query OK, 1 row affected (0.02 sec)
mysql> exit;
Bye
- sudo rm /usr/local/mysql
- sudo rm -rf/usr/local/mysql*
- sudo rm -rf/Library/StartupItems/MySQLCOM
- sudo rm -rf/Library/PreferencePanes/My*
- vim /etc/hostconfig (and removed the lineMYSQLCOM=-YES-)
- rm -rf~/Library/PreferencePanes/My*
- sudo rm -rf/Library/Receipts/mysql*
- sudo rm -rf/Library/Receipts/MySQL*
- sudo rm -rf/var/db/receipts/com.mysql.*
*Mac下新安装的MySQL无法登陆root用户解决方法:http://www.euryugasaki.com/archives/853
7.安装Navicat
Navicat 11.0.16破解版下载(此版本在最新版mac 10.11系统已无法破解):http://pan.baidu.com/s/1jGFBL3K
先点击dmg安装Navicat;
然后破解:
1.点击keygen.dmg里面的程序文件打开注册机(Yosemite最新Mac系统可能打不开,只要右击keygen程序文件打开显示简洁getinfo,勾选以32位模式打开选项openin 32-bit mode, 然后就可以打开了,同时系统要允许从所有地方anywhere下载APP软件资源,在设置-安全与隐私里面设置);
2.先点击Patch从应用中选择要破解的程序Navicat,然后点击generate生成注册码,最后activate激活就可以了,重启mac生效。
Navicat连接本地数据库
首先要启动mysql,然后在navicat里面点左上角新建一个mysql的连接connection:
输入信息: 连接名字随便起;
主机名或ip地址: 填localhost本机即可,或者127.0.0.1,这俩没啥区别,但也不完全一样,好像是localhost是什么socket协议,127.0.0.1是TCP/IP协议啥的,这里一样;
端口号port:,mysql是3306;
用户名: 这里连接root用户,密码是安装mysql时修改的那个;
可以点击左下角测试连接看是否能连接成功,然后点击ok连接即可;
每次连接都要输入用户密码;
在department里面放入一个html文件,就可以在浏览器访问了,但是访问的浏览器必须和服务器电脑在同一个网络里面:
4.PHP连接本地MYSQL数据库
;extension=php_mysql.dll
;extension=php_mysqli.dll
官网下载mysql的Mac版本:http://dev.mysql.com/downloads/mysql/
Xinhous-MacBook-Pro:~ username$ mysql -u root -p
另外也可以通过偏好设置里的mysql图标点开进行数据库开启关闭;
2.更改mysql root账户密码
进入mysql后修改root密码:
mysql> set password = password('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)
新密码已经设置为:123
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> create database jxh;
Query OK, 1 row affected (0.03 sec)
删除数据库:
mysql> drop database jxh;
Query OK, 0 rows affected (0.10 sec)
mysql> use mysql;
Database changed
显示mysql数据库中的所有表:
mysql> show tables;
mysql> create table user(uid int(10) not null,username varchar(20) not null,password varchar(20),primary key(uid));
mysql> desc user;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| uid | int(10) | NO | PRI | NULL | |
| username | varchar(20) | NO | | NULL | |
| password | varchar(20) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
3 rows in set (0.04 sec)
重命名表名(‘user’改为‘usertable’):
mysql> rename table user to usertable;
Query OK, 0 rows affected (0.03 sec)
删除表:
mysql> drop table usertable;
Query OK, 0 rows affected (0.03 sec)
向表中插入一条数据:
mysql> insert into user(uid,username,password) values(1,'jxh','123');
Query OK, 1 row affected (0.02 sec)
显示表中所有数据:
mysql> select * from user;
+-----+----------+----------+
| uid | username | password |
+-----+----------+----------+
| 1 | jxh | 123 |
+-----+----------+----------+
1 row in set (0.00 sec)
删除一条数据:
mysql> delete from user where uid=1;
Query OK, 1 row affected (0.02 sec)
mysql> exit;
Bye
- sudo rm /usr/local/mysql
- sudo rm -rf/usr/local/mysql*
- sudo rm -rf/Library/StartupItems/MySQLCOM
- sudo rm -rf/Library/PreferencePanes/My*
- vim /etc/hostconfig (and removed the lineMYSQLCOM=-YES-)
- rm -rf~/Library/PreferencePanes/My*
- sudo rm -rf/Library/Receipts/mysql*
- sudo rm -rf/Library/Receipts/MySQL*
- sudo rm -rf/var/db/receipts/com.mysql.*
*Mac下新安装的MySQL无法登陆root用户解决方法:http://www.euryugasaki.com/archives/853
7.安装Navicat
Navicat 11.0.16破解版下载(此版本在最新版mac 10.11系统已无法破解):http://pan.baidu.com/s/1jGFBL3K
先点击dmg安装Navicat;
然后破解:
1.点击keygen.dmg里面的程序文件打开注册机(Yosemite最新Mac系统可能打不开,只要右击keygen程序文件打开显示简洁getinfo,勾选以32位模式打开选项openin 32-bit mode, 然后就可以打开了,同时系统要允许从所有地方anywhere下载APP软件资源,在设置-安全与隐私里面设置);
2.先点击Patch从应用中选择要破解的程序Navicat,然后点击generate生成注册码,最后activate激活就可以了,重启mac生效。
Navicat连接本地数据库
首先要启动mysql,然后在navicat里面点左上角新建一个mysql的连接connection:
输入信息: 连接名字随便起;
主机名或ip地址: 填localhost本机即可,或者127.0.0.1,这俩没啥区别,但也不完全一样,好像是localhost是什么socket协议,127.0.0.1是TCP/IP协议啥的,这里一样;
端口号port:,mysql是3306;
用户名: 这里连接root用户,密码是安装mysql时修改的那个;
可以点击左下角测试连接看是否能连接成功,然后点击ok连接即可;
每次连接都要输入用户密码;