首页 技术 正文
技术 2022年11月15日
0 收藏 572 点赞 3,003 浏览 2193 个字

mysql开启远程访问:

默认情况下mysql的绑定ip是bind-address=127.0.0.1找到my.cnf

bitnami@linux:~$ sudo find / -name my.cnf
[sudo] password for bitnami:
/opt/bitnami/mysql/my.cnf
bitnami@linux:~$

注释掉这一行

[mysqladmin]
user=root[mysqld]
basedir=/opt/bitnami/mysql
datadir=/opt/bitnami/mysql/data
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
tmpdir=/opt/bitnami/mysql/tmp
max_allowed_packet=16M
#bind-address=127.0.0.1character-set-server=UTF8
collation-server=utf8_general_ci
[mysqld_safe]
mysqld=mysqld.bin[client]
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sockdefault-character-set=UTF8
[manager]
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
pid-file=/opt/bitnami/mysql/tmp/manager.pid
default-mysqld-path=/opt/bitnami/mysql/bin/mysqld.bin

这样就可远程访问。

bitnami下重启mysql服务的方法

$ cd /opt/bitnami
$ sudo ./ctlscript.sh restart mysql

mysql数据库连接看一下bitnami里面mysql的quick guide:   (像重置密码都在这个文档当中)http://wiki.bitnami.com/Components/MySQL#How_to_start.2fstop_the_MySQL_server.3f我觉得bitnami里面的所有东西安装有时按照一个套路来的,但是这个套路可能跟别人的不同。比如mysql的启动方法就是前面提到的,用ctlscript.sh来实现的。 virtual machine的mysql默认连接用户名是:root/bitnamimysql本地连接方式$ mysql -u root -p$ bitnami 如果想从别的机器上面访问mysql,还需要执行以下命令

$ /installdir/mysql/bin/mysql -u root -p -e "grant all privileges on *.* to 'root'@'%' identified by 'your_root_password' with grant option";

如果执行完上面的命令以后还不能远程登陆,那么就可能是防火墙的问题了,请开放3306端口。

查看防火墙状态

sudo ufw status

详细可以参考:https://help.ubuntu.com/community/UFW

启用phpMyAdmin(mysql页面管理器)

http://wiki.bitnami.com/Components/phpMyAdmin_and_phpPgAdmin#How_to_enable_phpMyAdmin_or_phpPgAdmin_to_be_accessed_remotely.3fphpMyAdmin is an easy to use management tool for MySQL that allows you to create and drop databases, create, drop and modify tables, delete, edit and add fields, execute SQL statements, manage keys on fields, manage privileges and export data in various formats through a web-based interface.但是上面的配置是有误的,因为找不到”installdir/apps/phpmyadmin/conf/phpmyadmin.conf”这个文件,后来在以下链接中找到答案。http://community.bitnami.com/t/phpmyadmin-conf-does-not-exist-in-the-phpmyadmin-folder/14293/3就是所有应用都是通过apache配置的,所以配置文件在/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf当中。具体可以参考apache的配置:http://wiki.bitnami.com/Components/Apache#How_to_configure_your_web_application.3f 配置完毕以后,通过http://YOUR_IP/phpmyadmin 进行访问,我的访问地址就是http://192.168.1.100:1280/phpmyadmin bitnami下mysql配置-包含phpMyAdmin配置 其实虚拟机端口绑定,然后使用navicat直接连接就可以。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,086
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,561
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,411
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,184
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,820
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,904