31
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
function SetNextCellFocus(source) {
var lastFocusCellName = source.name;
var els = document.getElementsByTagName("INPUT");
var lLength = els.length;
for (var i = 0; i < lLength; i++) {
if (els[i].name != null) {
if (els[i].name == lastFocusCellName && i + 1 < lLength) {
try {
els[i + 1].focus();
els[i + 1].select();
}
catch (err) { }
finally {
break;
}
}
}
}
}
ALTER TABLE dbo.TPURENTRY
DROP CONSTRAINT TPURENTRY_ADDITIONNALINFO_DF
GO
ALTER TABLE dbo.TPURENTRY
ALTER COLUMN ADDITIONNALINFO VARCHAR(MAX) NULL
GO
ALTER TABLE dbo.TPURENTRY
ADD CONSTRAINT TPURENTRY_ADDITIONNALINFO_DF DEFAULT '' FOR ADDITIONNALINFO
GO
[mysqld]
log-bin=mysql-bin
server-id=1
After making the changes, restart the server. /etc/rc.d/init.d/mysql restart
mysql -u root -p
Enter password:
Now we are on the MySQL shell. +---------------+----------+--------------+------------------+
| File | Position | Binlog_do_db | Binlog_ignore_db |
+---------------+----------+--------------+------------------+
| mysql-bin.006 | 183 | | |
+---------------+----------+--------------+------------------+
1 row in set (0.00 sec)
mysql> FLUSH TABLES WITH READ LOCK;
Remember to use SHOW MASTER STATUS and record the binary log details for use when starting up the slave. The point in time of your snapshot and the binary log position must match. shell> mysqldump --all-databases --lock-all-tables >dbdump.db
An alternative to using a bare dump, is to use the --master-data option, which automatically appends the CHANGE MASTER TO statement required on the slave to start the replication process. shell> mysqldump --all-databases --master-data >dbdump.db
3.In the client where you acquired the read lock, release the lock: mysql> UNLOCK TABLES;
Alternatively, exit the first session to release the read lock. /etc/rc.d/init.d/mysql restart
shell> mysql -h master < dbdump.db
CHANGE MASTER TO MASTER_HOST='192.168.0.100', MASTER_USER='slave_user', MASTER_PASSWORD='<some_password>', MASTER_LOG_FILE='mysql-bin.006', MASTER_LOG_POS=183;
START SLAVE;
quit;
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update pear/Mail requires PEAR Installer (version >= 1.5.6), installed version is 1.5.0 No valid packages found install failed
pear channel-update "pear.php.net"
pear upgrade-all
pear/Mail requires PEAR Installer (version >= 1.5.6), installed version is 1.4.9
No valid packages found
install failed
pear upgrade --force pear
pear install --alldeps Mail
587 inet n - n - - smtpd
/etc/init.d/postfix restart
# /etc/init.d/mysql stop
Output:# mysqld_safe --skip-grant-tables &
Output: # mysql -u root
Output: mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Step # 5: Stop MySQL Server: # /etc/init.d/mysql stop
Output:[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/English
bind-address = 65.55.55.2
# skip-networking
....
..
....
# /etc/rc.d/init.d/mysqld restart
Step # 5 Grant access to remote IP address$ mysql -u root -p mysql
Grant access to a new databaseCREATE DATABASE foo;
mysql> GRANT ALL ON foo.* TO bar@'202.54.10.20' IDENTIFIED BY 'PASSWORD';
How Do I Grant Access To An Existing Database?mysql> update db set Host='202.54.10.20' where Db='webdb';
mysql> update user set Host='202.54.10.20' where user='webadmin';
Step # 5: Logout of MySQL<?php
// Create a new image instance
$im = imagecreatetruecolor(100, 100);
// Make the background white
imagefilledrectangle($im, 0, 0, 99, 99, 0xFFFFFF);
// Draw a text string on the image
imagestring($im, 3, 40, 20, 'GD Library', 0xFFBA00);
// Output the image to browser
header('Content-type: image/gif');
imagegif($im);
imagedestroy($im);
?>
pear install --alldeps Mail
[message] => authentication failure [SMTP: Invalid response code received from server (code: 454, response: TLS currently unavailable)]
chown mail:mail /etc/exim.cert
chown mail:mail /etc/exim.key
/* require the user as the parameter */
if(isset($_GET['user']) && intval($_GET['user'])) {
/* soak in the passed variable or set our own */
$number_of_posts = isset($_GET['num']) ? intval($_GET['num']) : 10; //10 is the default
$format = strtolower($_GET['format']) == 'json' ? 'json' : 'xml'; //xml is the default
$user_id = intval($_GET['user']); //no default
/* connect to the db */
$link = mysql_connect('localhost','username','password') or die('Cannot connect to the DB');
mysql_select_db('db_name',$link) or die('Cannot select the DB');
/* grab the posts from the db */
$query = "SELECT post_title, guid FROM wp_posts WHERE post_author = $user_id AND post_status = 'publish' ORDER BY ID DESC LIMIT $number_of_posts";
$result = mysql_query($query,$link) or die('Errant query: '.$query);
/* create one master array of the records */
$posts = array();
if(mysql_num_rows($result)) {
while($post = mysql_fetch_assoc($result)) {
$posts[] = array('post'=>$post);
}
}
/* output in necessary format */
if($format == 'json') {
header('Content-type: application/json');
echo json_encode(array('posts'=>$posts));
}
else {
header('Content-type: text/xml');
echo '<posts>';
foreach($posts as $index => $post) {
if(is_array($post)) {
foreach($post as $key => $value) {
echo '<',$key,'>';
if(is_array($value)) {
foreach($value as $tag => $val) {
echo '<',$tag,'>',htmlentities($val),'</',$tag,'>';
}
}
echo '</',$key,'>';
}
}
}
echo '</posts>';
}
/* disconnect from the db */
@mysql_close($link);
}
http://mydomain.com/web-service.php?user=2&num=10
Now, we can take a look at the possible results of the URL.<posts>
<post>
<post_title>SSLmatic SSL Certificate Giveaway Winners</post_title>
<guid>http://davidwalsh.name/?p=2304</guid>
</post>
<post>
<post_title>MooTools FileManager</post_title>
<guid>http://davidwalsh.name/?p=2288</guid>
</post>
<post>
<post_title>PHPTVDB: Using PHP to Retrieve TV Show Information</post_title>
<guid>http://davidwalsh.name/?p=2266</guid>
</post>
<post>
<post_title>David Walsh: The Lost MooTools Plugins</post_title>
<guid>http://davidwalsh.name/?p=2258</guid>
</post>
<post>
<post_title>Create Short URLs Using U.Nu</post_title>
<guid>http://davidwalsh.name/?p=2218</guid>
</post>
<post>
<post_title>Create Bit.ly Short URLs Using PHP</post_title>
<guid>http://davidwalsh.name/?p=2194</guid>
</post>
<post>
<post_title>Represent Your Repositories Using the GitHub Badge!</post_title>
<guid>http://davidwalsh.name/?p=2178</guid>
</post>
<post>
<post_title>ZebraTable</post_title>
<guid>http://davidwalsh.name/?page_id=2172</guid>
</post>
<post>
<post_title>MooTools Zebra Table Plugin</post_title>
<guid>http://davidwalsh.name/?p=2168</guid>
</post>
<post>
<post_title>SSLmatic: Quality, Cheap SSL Certificates and Giveaway!</post_title>
<guid>http://davidwalsh.name/?p=2158</guid>
</post>
</posts>
http://mydomain.com/web-service.php?user=2&num=10&format=json
{"posts":[{"post":{"post_title":"SSLmatic SSL Certificate Giveaway Winners","guid":"http:\/\/davidwalsh.name\/?p=2304"}},{"post":{"post_title":"MooTools FileManager","guid":"http:\/\/davidwalsh.name\/?p=2288"}},{"post":{"post_title":"PHPTVDB: Using PHP to Retrieve TV Show Information","guid":"http:\/\/davidwalsh.name\/?p=2266"}},{"post":{"post_title":"David Walsh: The Lost MooTools Plugins","guid":"http:\/\/davidwalsh.name\/?p=2258"}},{"post":{"post_title":"Create Short URLs Using U.Nu","guid":"http:\/\/davidwalsh.name\/?p=2218"}},{"post":{"post_title":"Create Bit.ly Short URLs Using PHP","guid":"http:\/\/davidwalsh.name\/?p=2194"}},{"post":{"post_title":"Represent Your Repositories Using the GitHub Badge!","guid":"http:\/\/davidwalsh.name\/?p=2178"}},{"post":{"post_title":"ZebraTable","guid":"http:\/\/davidwalsh.name\/?page_id=2172"}},{"post":{"post_title":"MooTools Zebra Table Plugin","guid":"http:\/\/davidwalsh.name\/?p=2168"}},{"post":{"post_title":"SSLmatic: Quality, Cheap SSL Certificates and Giveaway!","guid":"http:\/\/davidwalsh.name\/?p=2158"}}]}