1. mysql server installed on windows
if you want to connect the mysql server from the remote windows cliect,
you need to modify the user table of mysql database in mysql server, as follow:
update user set host = '%' where user = 'root';
or
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;(Note: password is root user's password)
if you want to connect to mysql server from a bind machine, you can execute the command:
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.8' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
so you can connect to mysql server from the 192.168.1.8 machine.
grant definition: grant rights on database's object to user
localhost: express you can login mysql server from localhost
%: express you can login from any machine in your network
2. mysql server installed on linux
if you want to connect the mysql server from the remote windows client, please follow the 1 step above.
if you can't login yet, you can modify the /etc/mysql/my.cnf file, remove or comment the "bind-address = 127.0.0.1" sentence,
this sentence express the mysql server only listen to the localhost machine.
分享到:
相关推荐
Navicat Premium is a multi-connections Database Administration tool allowing you to connect to MySQL, SQL Server, SQLite, Oracle and PostgreSQL databases simultaneously within a single application, ...
这个项目"connect-remote-database-demo"显然是一个示例,旨在展示如何使用Java语言来实现这一功能。Java作为一种多平台、跨语言的编程工具,非常适合处理数据库连接。本项目的核心知识点主要包括以下几个方面: 1....
MySQL Connector/J是按照Java Database Connectivity (JDBC) API规范实现的,这是一个由Sun Microsystems(现为Oracle公司)定义的标准接口,用于在Java应用和各种数据库之间建立连接。JDBC允许Java开发者编写与...
$conn = mysql_connect($mysql_server_name, "root", "123456"); mysql_select_db("gbook"); $sql = "INSERT INTO `gbook` (`id`, `name`, `sex`, `email`, `info`, `ip`, `time_at`) VALUES (NULL, '$name', '$sex...
else $this->conn=mysql_connect($this->host,$this->user,$this- >pass); // 临时链接 if (!$this->conn) $this->show_error('无法连接服务器'); $this->select_db($this->data); $this->query('SET NAMES '.$...
CONNECT TO remote_user IDENTIFIED BY remote_password USING 'remote_database_connect_string'; ``` 例如,如果要从本地数据库连接至名为ORCL的远程数据库,可以使用以下命令: ```sql CREATE DATABASE LINK ...
console.log('新连接建立:', socket.remoteAddress + ':' + socket.remotePort); socket.on('data', (data) => { console.log('接收到数据:', data.toString()); // 在这里处理数据并将数据保存到MySQL }); ...
Used by metastore client to connect to remote metastore. <!-- 元数据使用mysql数据库 --> <name>javax.jdo.option.ConnectionURL <value>jdbc:mysql://bigdata01:3306/hive?createDatabaseIfNotExist=...
使用了MySQL_connect()函数来建立数据库连接。这个函数需要三个参数:数据库服务器地址($server),数据库用户名($db_user),和数据库密码($db_pass)。连接成功后,使用数据库名($database)来选择数据库。 3...
可以使用Java的JDBC(Java Database Connectivity)接口来连接和操作数据库,如MySQL或Oracle。数据库中应包含用户信息(如ID、姓名、权限等级)、门禁记录(进出时间、地点)等表。ORM(Object-Relational Mapping...
'mysql://%s:%s@127.0.0.1:%d/%s' % (databaseA_usr, databaseA_pwd, server.local_bind_port, databaseA_db) ) # 在这里使用destination_lib进行数据库操作 server.close() ``` 总结来说,Python通过SSH访问...
$conn = mysql_connect($mysql_server_name, $mysql_username, $mysql_password); // 准备SQL语句 - 新增数据 $sql = "INSERT INTO `num` (`name`, `ip`, `new`) VALUES ('badwolf', '$ip', '1')"; // 选择要操作...
<description>Username to use against metastore database <name>javax.jdo.option.ConnectionPassword <value>your_password <description>Password to use against metastore database ``` **5. 初始化...
- ODBC Driver for MySQL:连接到MySQL数据库。 - ODBC Driver for Oracle:连接到Oracle数据库。 - ODBC Driver for SQL Server:连接到Microsoft SQL Server。 2. ODBC DSN-Less Connections(无DSN连接): ...
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));UID=myuser;PWD=mypassword;"; ``` - **ODBC Driver for Paradox**: 连接...
3. **数据库连接和操作**:文档中提到了mysql_connect()函数,这是PHP中用于连接MySQL数据库的函数。还提到了mysql_query()函数,用于执行SQL查询。这些是PHP与MySQL数据库交互的基础技术。 4. **数据库设计和SQL...
Perl可以使用多种数据库接口模块,如DBI(Database Interface)来连接和操作MySQL、SQLite、PostgreSQL等数据库。以下是一个使用DBI模块的例子: ```perl use DBI; my $db_name = 'network_speeds'; my $db_user =...
// Connect to database // ... $id = intval($_POST['id']); $ip = $_SERVER['REMOTE_ADDR']; // Check if IP exists in pic_ip $query = "SELECT * FROM pic_ip WHERE ip='$ip' AND pic_id='$id'"; $result = ...
$conn = new mysqli('localhost', 'username', 'password', 'database'); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $query = "SELECT city FROM iptocity WHERE ip...