如果您想了解在phpMyAdmin中登录时是否可以指定主机?和phpmyadmin如何登录的知识,那么本篇文章将是您的不二之选。我们将深入剖析在phpMyAdmin中登录时是否可以指定主机?的各个方面
如果您想了解在phpMyAdmin中登录时是否可以指定主机?和phpmyadmin如何登录的知识,那么本篇文章将是您的不二之选。我们将深入剖析在phpMyAdmin中登录时是否可以指定主机?的各个方面,并为您解答phpmyadmin如何登录的疑在这篇文章中,我们将为您介绍在phpMyAdmin中登录时是否可以指定主机?的相关知识,同时也会详细的解释phpmyadmin如何登录的运用方法,并给出实际的案例分析,希望能帮助到您!
本文目录一览:- 在phpMyAdmin中登录时是否可以指定主机?(phpmyadmin如何登录)
- linux下phpmyadmin的安装 phpmyadmin linux配置 phpmyadmin 配置 linux phpmyadmin下
- mysql – 临时表在PHPMyAdmin中不起作用
- mysql – 在phpMyAdmin中哈希
- MySQL查询在phpMyAdmin中工作,在PHP中失败
在phpMyAdmin中登录时是否可以指定主机?(phpmyadmin如何登录)
每当我需要连接到不同的服务器时,我必须编辑config.inc.PHP中的主机字段.
http://www.onlinehowto.net/config-multiple-servers-in-PHPmyadmin/1405 /* Single server config section */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'dbsub'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select MysqLi if your server has it */ $cfg['Servers'][$i]['extension'] = 'MysqL';
Above six lines of code configure PHPMyAdmin to connect to one server. Notice the i > variable that gets increased on the fist line $i++. To define another server just you need to copy paste the block above and change the hostname. It is very important to have the $i++ statement before each databases server configuration. The servers Could also be from different database type. For example MysqL and Postgresql. This is why PHPMyAdmin is so popular and loved.
Here is working setup in one of the PHPmyadmin instances that we manage
/* * Servers configuration */ $i = 0; /* * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'db'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select MysqLi if your server has it */ $cfg['Servers'][$i]['extension'] = 'MysqL'; /* * Second server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'dbsub'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select MysqLi if your server has it */ $cfg['Servers'][$i]['extension'] = 'MysqL'; /* * Third server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'stats1'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select MysqLi if your server has it */ $cfg['Servers'][$i]['extension'] = 'MysqL'; $cfg['displayServersList'] = TRUE; /* * End of servers configuration
The final change that will make the list of servers show in a nice dropdown list in the login scree is the $cfg[”displayServersList”] = TRUE; statement. This way any time you go to the login page of PHPmyadmin you will have to select the server you want to work on.
linux下phpmyadmin的安装 phpmyadmin linux配置 phpmyadmin 配置 linux phpmyadmin下
mysql – 临时表在PHPMyAdmin中不起作用
我运行这个查询
CREATE TEMPORARY TABLE usercount SELECT * FROM users
我收到这条消息
Your sql query has been executed successfully ( Query took 0.1471 sec )
但是当我尝试使用时访问新创建的表
SELECT * FROM usercount
我收到这个错误
#1146 - Table 'abc_site.usercount' doesn't exist
不知道为什么,我需要提一下,我之前已经分享了很多谷歌搜索.
我的PHPMyAdmin版本是3.5.2.2和MysqL 5.5.27
您可以在PHPMyAdmin的SQL查询框中放置多个sql语句;这应该作为一个块执行,因此不删除临时表.
mysql – 在phpMyAdmin中哈希
我有一个MysqL数据库,我正在使用PHPMyAdmin来访问它.数据库具有表员工,其中包含姓名,地址,电子邮件和密码等字段.
最初,密码字段只是VARCHAR(20).但现在我想用SHA-256哈希技术哈希我的密码.
我对数据库没有太多经验,所以我想知道的是 –
>我可以在不影响其他字段或整个表格的情况下散列所有当前员工的密码吗?
>将来当我在数据库中输入数据时(来自Web应用程序),我在哪里编写散列函数来散列密码?即,是否在前端发生散列,然后散列密码存储在DB中,或者密码进入散列然后存储的DB.
解决方案和建议表示赞赏.
答:是的.但是您需要将密码列的大小改为40-42.您将使用PASSWORD()内置函数来加密您的密码
ALTER TABLE tableName MODIFY `password` VARCHAR(42);
之后,您现在可以更新密码列
UPDATE tablename
SET `password` = PASSWORD(`password`);
前).
abcde12345 => *20B30AFAF441808B50273EDA287132EC25B02DE2
Q2:将来当我在数据库中输入数据时(来自Web应用程序),我在哪里编写散列函数来散列密码?
答:在您的INSERT查询中
INSERT INTO tableName (name,address,email,password)
VALUES ('aa','bb',''cc,PASSWORD('abcde12345'))
当您要搜索密码时,首先加密文本:
SELECT *
FROM tableName
WHERE `password` = PASSWORD('abcde12345')
还有一件事,不要忘记使用反引号来转义密码列,因为它是MySQL Reserved Word.
MySQL查询在phpMyAdmin中工作,在PHP中失败
SELECT sql_CALC_FOUND_ROWS *
FROM (
SELECT *
FROM tbl_substances
LIMIT 0,25
) AS s
LEFT JOIN (
SELECT subid,list1,list2,list3,list4,list5
FROM tbl_substances_lists
WHERE orgid = '1'
) AS x ON s.subst_id = x.subid
LEFT JOIN (
SELECT subid,info
FROM tbl_substances_info
WHERE orgid = '1'
) AS y ON s.subst_id = y.subid
这个想法是你有一个物质的主列表(tbl_substances)然后如果你在tbl_substances_lists或tbl_substances_info中输入了关于它们的任何信息,那么也可以显示(只要你使用正确的组织ID登录)
显示所有物质非常重要,即使它们没有自定义信息,这就是我使用LEFT JOIN的原因.
此查询在PHPMyAdmin中完美运行,但当我在我的数据库脚本中使用它时,我得到:
You have an error in your sql Syntax; check the manual that corresponds to your MysqL server version for the right Syntax to use near ‘) AS s LEFT JOIN (SELECT subid,list5 FROM tbl_substances_’ at line 2
我不确定问题是否是显而易见的我错过了,或者是否与这个代码使用MysqL_query的事实有关,我知道这个问题已被弃用和老式等等.
我不是数据库专家,所以如果这个查询看起来很难看,那我就提前道歉!
编辑2
这是构建此查询的代码(它根据您要搜索的内容动态构建,但这是基本形式)
/*
* Length
*/
if ( isset( $_POST['idisplayStart'] ) && $_POST['idisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".MysqL_real_escape_string( $_POST['idisplayStart'] ).",".
MysqL_real_escape_string( $_POST['idisplayLength'] );
}
/*
* Ordering
*/
$sOrder = "";
if ( isset( $_POST['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $iMysqL_real_escape_string( $_POST['sSortDir_'.$i] ) .",";
}
}
$sOrder = substr_replace( $sOrder,"",-2 );
if ( $sOrder == "ORDER BY" )
{
$sOrder = "";
}
}
/*
* Table info
*/
$sTable = "tbl_substances ".$sLimit.") AS s
LEFT JOIN (
SELECT subid,list5
FROM tbl_substances_lists
WHERE orgid = '".$orgid."'
) AS x
ON s.subst_id = x.subid
LEFT JOIN (
SELECT subid,info
FROM tbl_substances_info WHERE orgid = '".$orgid."'
) AS y
ON s.subst_id = y.subid";
$sWhere = "";
/*
* sql queries
* Get data to display
*/
$sQuery = "
SELECT sql_CALC_FOUND_ROWS * FROM (SELECT * FROM $sTable
$sWhere
$sOrder
$sLimit
";
$rResult = MysqL_query( $sQuery ) or die(MysqL_error());
想象一下,$sWhere和$sOrder目前没有任何内容 – $sLimit由用户选择,但在这种情况下,它将是LIMIT 0,25来获得前25个记录.
在这种情况下,这一切都结合起来,以回显$sQuery:
SELECT sql_CALC_FOUND_ROWS *
FROM (
SELECT *
FROM tbl_substances LIMIT 0,25
) AS s
LEFT JOIN (
SELECT subid,list5
FROM tbl_substances_lists
WHERE orgid = '1'
) AS x
ON s.subst_id = x.subid
LEFT JOIN (
SELECT subid,info
FROM tbl_substances_info
WHERE orgid = '1'
) AS y
ON s.subst_id = y.subid
SELECT sql_CALC_FOUND_ROWS *
FROM tbl_substances s
LEFT JOIN tbl_substances_lists x ON s.subst_id = x.subid AND x.orgid = '1'
LEFT JOIN tbl_substances_info y ON s.subst_id = y.subid AND y.orgid = '1'
LIMIT 0,25
应该给出相同的结果.
今天的关于在phpMyAdmin中登录时是否可以指定主机?和phpmyadmin如何登录的分享已经结束,谢谢您的关注,如果想了解更多关于linux下phpmyadmin的安装 phpmyadmin linux配置 phpmyadmin 配置 linux phpmyadmin下、mysql – 临时表在PHPMyAdmin中不起作用、mysql – 在phpMyAdmin中哈希、MySQL查询在phpMyAdmin中工作,在PHP中失败的相关知识,请在本站进行查询。
本文标签: