1. 激活root用户:
sudo passwd root
2. 安装ssh服务:
sudo apt-get install openssh-server
开启服务:/etc/init.d/ssh start
关闭服务:/etc/init.d/ssh stop
重启服务:/etc/init.d/ssh restar
3. 安装pip:
wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
sudo python get-pip.py
4. 安装virtualenv和virtualenvwrapper
sudo apt-get update
sudo apt-get install python-virtualenv
sudo easy_install virtualenvwrapper
5. 安装mysql
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
登陆: mysql -u root -p
6. Ubuntu上设置MySQL可以远程访问
修改/etc/mysql/mysql.conf.d/mysqld.cnf,将里面的bind-address = 127.0.0.1注释掉。
6.1 对所有远程用户授权:
grant all privileges on *.* to 'root'@'%' identified by '123456'; #root为远程登录用户,123456为远程登录用户的密码
6.2 对指定IP授权:
GRANT ALL PRIVILEGES ON *.* TO root@'指定的IP地址' IDENTIFIED BY 'root用户密码' WITH GRANT OPTION;
flush privileges;
重启mysql: /etc/init.d/mysql restart