I have a database , there are some table in it , in this database , there is a string "error" , I would like to change it to "warning" , except export all data to text , find and replace string , and then import back to database , is there other method may bulk update the string ? thanks
Afternoon forumer's
Im trying to have a if statement perform a check to throw out a string that contains alphanumeric
so anything like ^*&(*"
ive been racking my brain with if statements and checks like
if [ $string = "\^|\*" ]
then
echo "string contains incorrect characters"
fi
however i cant figure it :\
I'm a newby Slackware(14.1) user, I downloaded and installed the SlackBuild for lemonpos, also installed mysql database Ok, but when I star squeeze or lemon it asking me the administrator or supervisor username and password,I try admin-linux and didn't work, also get those error's:
setup Logs.. done, QSqlError(-1, "Unable to find table logs", "")
Login()
Error** : QSqlError(1046, "QMYSQL: Unable to execute query", "No database selected"
No database selected QMYSQL: Unable to execute query"
**Error** : QSqlError(1046, "QMYSQL: Unable to execute query", "No database selected")
squeeze(2233) KPlotWidget::Private::calcDataRectLimits: y1 and y2 cannot be equal. Setting y2 = y1 + 1.0
Any helps, I'll apreciate. the domain lemonpos is not available.
Homepage: http://lemonpos.org/.
Hello,
I apologize in advance for my limited UNIX scripting knowledge. I am new to it and really want to learn.
I am trying to write a bash script that updates a config file based on user input.
What is the best method for accomplishing this? I need it to prompt the user for two variables, find the location in the config file, and insert new text with the two variables.
I was thinking I could use sed to find the text in the config file where the new text must be inserted before and replace it with the new text, two variables, and same ending text as before. Example:
echo "1st variable?"
read variable1
echo "2nd variable?"
read variable2
sed -e "s|<the spot in the config file that needs new config>|sometext...$variable2_somemoretext...$variable1\n<the spot in the config file that needs new config>|g" config > config2
This works except variable2 is not inserted into the replace string, only variable1 is. This is the result in config2:
sometext..._somemoretext...$variable1
<the spot in the config file that needs new config>
If anyone can tell me why variable2 isn't working in the sed replace string, or if there's a much better way for accomplishing what I'm after, I'd appreciate any help I can get.
Hello,
I' ve already install the ns-2.29.
But when i want to execute nam.
I have this error :nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {..."
How can i install it?
I am in the process of setting up my first VPS to host a website that I have been working on. By profession, I am a programmer, so I know nothing of Linux or web hosting!!
Thanks to lots of help on here this weekend, I finally learned how to access my VPS using SSH. (That only took a day or two to learn!) And my first command-line task was learning how to copy a file to another folder while maintaining the original modified date. (That only took another half-day!)
Whew!
So the next thing that I need to do is set up MySQL on my VPS...
My VPS runs on CentOS 6, and it also comes with cPanel, but since astrogeek and Miati were persistent in explaining why it is better to do things via the command-line versus using a GUI, I figured I would check things out...
My cPanel comes with some "wizard" that supposedly sets up a MySQL database for you, but whenever I see "wizard" I tend to run!
Advanced Support for my web host said that I should definitely use cPanel to create my database and create the users, because if I did it using phpMyAdmin it would supposedly mess things up as cPanel wouldn't recognize things?
(BTW, I requested MySQL Root access this morning, but I do not have Root access to my VPS - by choice for now!)
Questions:
1.) Should I listen to my web host and use the cPanel wizard to create a new MySQL database?
2.) If I decide to bypass cPanel, how exactly would I use my MacBook to talk to my VPS and do MySQL stuff over command-line?
FWIW, I developed my entire database using phpMyAdmin in MAMP on my MacBook. When I created my original database in development, I used phpMyAdmin's GUI. And then for everything else (e.g. create table, indexes, queries, etc.), I hand-wrote the SQL in TextEdit and then ran it in phpMyAdmin.
But I have no clue how to do any of this on my VPS!!
3.) How would I use the command-line to create a new database and set up groups and users for MySQL?
4.) If I did things by command-line, is it true that I would break cPanel?
I have been working on my website for the last 3 years, and it is ready to "go live", but I am discovering that setting up my VPS properly - and with lots of security - and getting things like PHP and MySQL set up is a very daunting task!!!
Sincerely,
Rob
I need to execute this .bashrc string:
alias lml='grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' mail.log | grep "relay=" | awk '{print $8}'' #list mail log
I have tried enclosing the string in alias as lml="..." and alias lml=`...` to no avail. The problem is apparently with the grep "relay=" in that it has to be enclosed in "", as well as the awk that has to be enclosed in ''.
Any ideas on how to get this setup? Thanks.
hi i have the following file which contains.
HOSTNAME1 randomstring1
HOSTNAME12 randomstring2
id like to change it to
<name>HOSTNAME1</name>
<string>randomstring1</string>
<name>HOSTNAME12</name>
<string>randomstring2</string>
Please help
I have installed httpd, mysql, php on a centos machine. Php executes in the browser of my machines website, mysql can be ran from the command line, but mysql within php in a browser will not work.
I know my code is syntactically correct since it will run on another Centos Lamp machine and NetBeans says it is.
My code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="300">
<title> Freeze Warn Points table Query"</title>
</head>
<body>
<?php
include("config.php");
echo $dbhost;
echo "<br />\n";
echo $dbuser;
echo "<br />\n";
echo $dbpasswd;
echo "<br />\n";
mysql_connect($dbhost, $dbuser, $dbpasswd) or die("Unable to connect to database");
echo 'Connected Successfully';
mysql_select_db($dbname);
echo "zone"." ";
echo "currentLow"." "."dateLastRep"." ";
echo "priority"." "."siteId"." &nbs p; "."siteName";
echo "<br />\n";
$result = $sql = 'SELECT zone, currentLow, dateLastRep, pri, siteId, siteName from points order by zone, pri';
$numRows = mysql_num_rows($result);
echo "Matches: ".mysql_num_rows($result);
for($a=0; $a<$numRows; $a++)
{ $rowArray = mysql_fetch_row($result);
echo $rowArray[0]." ".$rowArray[1]." ".$rowArray[2]." ".$rowArray[3]." ".$rowArray[4]."  ".$rowArray[5]."<br />";
}
mysql_close();
?>
</body>
</html>
When executed on the CENTOS lamp machine in question out puts this
"; $result=mysql_query("SELECT rpad(zone,6,'-'), rpad(currentLow,13,'-'), rpad(dateLastRep,13,'-'), rpad(pri,8,'-'), rpad(siteId,6,'-'), siteName from points order by zone, pri"); $numRows = mysql_num_rows($result); for($a=0; $a<$numRows; $a++) { $rowArray = mysql_fetch_row($result); echo $rowArray[0]." ".$rowArray[1]." ".$rowArray[2]." ".$rowArray[3]." ".$rowArray[4]." ".$rowArray[5]."
"; } mysql_close(); ?>
When I put the same code in the other machine, (it does not have the mysql database so it will not connect) displays this
204.227.112.31
apache
password
Unable to connect to database
httpd is running of course
mysqld is running
I have
mysql-server-5.1.73-3.el6_5.x86_64
php-mysql-5.3.3-40.el6_6.x86_64
mysql-devel-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
mysql-5.1.73-3.el6_5.x86_64
php-mbstring-5.3.3-40.el6_6.x86_64
php-odbc-5.3.3-40.el6_6.x86_64
php-imap-5.3.3-40.el6_6.x86_64
php-mysql-5.3.3-40.el6_6.x86_64
php-xml-5.3.3-40.el6_6.x86_64
phpmyadmin-2.11.11.3-2.el6.rf.noarch
php-cli-5.3.3-40.el6_6.x86_64
php-xmlrpc-5.3.3-40.el6_6.x86_64
php-gd-5.3.3-40.el6_6.x86_64
php-5.3.3-40.el6_6.x86_64
php-pdo-5.3.3-40.el6_6.x86_64
php-common-5.3.3-40.el6_6.x86_64
php-ldap-5.3.3-40.el6_6.x86_64
php-pear-1.9.4-4.el6.noarch
Installed.
I checked the php.ini files and the httpd.conf files with the LAMP machine it works on and have been unable to find any discrepancies.
Unless I missed something.
Selinux is disabled.
I know it is not my code, but some type of setting somewhere on my machine, I have not been able to find.
I have been unable to find any thing like this issue.
Thanks,
Nancy
I've been using this a lot:
find <directory to start search at> -name "<files to search in>" -type f | xargs grep "<string to search for>"
e.g.
find /usr/include -name "*.h" -type f | xargs grep "#define UINT"
now what if I wanted to output the results to a file?
Hi All,
Using grep command with a defined string, you will get the row. Can I get the column instead of row? For example,
the file content is as below:
AA BB
123 456
789 ABE
execute 'grep ABE file' will give you "789 ABE". Is there any way to get the column:
BB
456
ABE
?
Thank you very much.