Ubuntu Servers :: LAMP - Insert UK Formatted Date Into MySQL
Sep 5, 2010
Trying to take a UK formatted date (30/12/2010) and insert it into Mysql (2010-12-30) is just not going to plan. I have a feeling I'm getting close, however it's just not working out.
Code:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$unformatted_date = $_POST['date'];
$formatted_date = substr($unformatted_date,6,4) . "-" . substr($unformatted_date,3,2) . "-" . substr($unformatted_date,0,2);
[Code]....
View 3 Replies
ADVERTISEMENT
Dec 11, 2010
Does anyone have a simple to use bash script or some such that will convert MSSQL dump files to MySQL formatted dump files?
View 6 Replies
View Related
Mar 12, 2011
I would like to store JPG files in a mysql database table. I figured that using BLOB fields on the one hand and the 'load_file' command on the other would do the trick. Here is how I set up the table:
mysql> create table blobtable (id int(10) not null auto_increment,
fileName varchar(15) not null,
file longblob not null, primary key(id) );
Query OK, 0 rows affected (0.51 sec)
Then I tried to enter the data:
mysql> insert into blobtable(filename,file)values('pic',load_file('/var/www/temp/IMGP4764.JPG'));
Which got me the following error signal:
ERROR 1048 (23000): Column 'file' cannot be null
It seems to me that the file path to the JPG file (although correct) is the source of the problem, and is causing the load_file command not to work. My first attempt was with the JPG file in my PC's home directory. When that returned the same error message, I figured that maybe the file had to be in the PC's (server's) web area so I put it under the 'www' directory.
View 7 Replies
View Related
Nov 2, 2010
it seems i have successfully installed LAMP.. i have a very basic page below that works when invoking "data()" but when i try to connect to mysql server (by removing the comments "//") it would just return a blank page.
[Code]...
View 1 Replies
View Related
Sep 23, 2010
I am manually backing up my server now with mysqldump and that works but I was wondering about mechanizing the process.
Nirvana would be to dump to a file named with the date
This way I have backups going back over time
View 9 Replies
View Related
Nov 10, 2010
im in the process of installing LAMP. im presently installing mysql and that's where i got into trouble...
im following the this tutorial [URL]
i tried the following :
Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:
mysql -u root
and i got this output:
root@konlah-laptop:/home/konlah# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
obviously my question is why can't i connect to local mysql?
View 4 Replies
View Related
Jul 12, 2011
When i enter this query to mysql:
Code:
return this error:
Code:
when i delete the insert part :
Code:
query is ok:
Code:
1 row in set (0.00 sec)
View 2 Replies
View Related
Jun 24, 2015
I installed LaMp 2 days ago. First everything works; But until yesterday, I can't start anymore mysql server : it failed each time.
When I look at the status :
Code: Select allsystemctl status mysql
Failed to get D-Bus connection: Erreur inconnue -1
It's like it can't generate mysqld.sock
Code: Select all/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
I keep reading man and trying to find something I didn't configure correctly, but I can't find nothing.
View 1 Replies
View Related
Feb 9, 2010
I want to insert values into a MySql database. The following line works fine:1
Code:
mysql_query(connection, "INSERT INTO main (NumofShows , Title) VALUES('12', 'Home')");
but if the data to be inserted is from a string... like....
Code:
string NewTitle = "Monaco";
string NumofShows = "2";
How do i edit my sql statements so variables can be inserted into the Values ( ) , and it will be able to read the variables and then store it into the database.
View 4 Replies
View Related
Mar 16, 2010
Good tutorial, using images for a lamp server that has, MySQL,PHP, Apache, FTP with all the fruit for running a server that will host a Gallery, forum and main site
I know there's heaps around for Ubuntu 9.10, but its not quiet what I'm looking for as in Gd, ImageMagick and some extras for Apache mods
View 1 Replies
View Related
Feb 23, 2011
I am trying to locate the path for MySQL installed trough LAMP. if someone could point it for me or how to locate this path.
View 1 Replies
View Related
Jan 16, 2011
i am trying to set up LAMP on an old pc i have installed linux, apache, mySQL and PHP following this guide Installing Apache2 With PHP5 And MySQL Support On OpenSUSE 11.3 (LAMP) | HowtoForge - Linux Howtos and Tutorials. i have installed phpMyAdmin but when i try and acess it i get this error
Error
MySQL said:
Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
[Code]...
View 1 Replies
View Related
Oct 2, 2010
the project I'm working on requires parsing a text file with fields separated by the | char and using perl to insert/update a mysql database. Some of the fields are simple numeric and others are text fields. In some of the text fields I run into a problem creating a proper insert statement for the perl api to mysql if I don't escape the single quote (') char with a backslash (). I can take each text file and do a manual subsitutiton, but I would prefer to use the script that prepares the text file to do it for me. I've tried sed (ex: sed s/'/\'/g ) and it runs cleanly, but does nothing to accomplish my goal. I suppose I could write a function to read the file character by character and write it out that way, but it seems a waste.
View 2 Replies
View Related
Mar 5, 2011
I need to create a sandbox environment on my LAMP server for PHP/MySql development. Anyone who could point me in the right direction or share their insight?
View 1 Replies
View Related
Nov 6, 2013
I have mysql installed successfully. I can insert rows into my table using phpMyAdmin. I can successful retrieve those rows in PHP with a select statement. However, I cannot insert or update rows from PHP. I get no error messages and everything appears to be working okay, just no results in mysql table.
View 0 Replies
View Related
Aug 12, 2010
I started over combining the first parts of this guide: [URL]..ubuntu8.04 (Only the first few parts in terms of configuration and naming). Then I used this guide: [URL]..Surprisingly enough all steps worked.
1. Now I need to set up LAMP servers with MySQL master/slave replication and Apache rsync.
2. Next i need to add BIND to both my Load Balancers with master/slave backup and replication...
Are there any guides to look at to follow on these? Can tou point me to the right direction for BIND with replication.
View 1 Replies
View Related
Mar 17, 2010
I have a script (below) which works ok, but I have tried to modify it as I want to keep the older files for a restore if needed. I have tried adding a date suffix to the newly created files (second lump of code), but it doesn't seem to work.I get the error:
$SOURCEDIR/p1db_$DATEVAR.sql: ambiguous redirect
The working original script:
Code:
#!/bin/bash[code].....
View 1 Replies
View Related
Jun 30, 2011
I'm actually tryinng to order all by DATE on MySQL but seems not to be possible.The date order is like this for example: Wednesday, June 29, 2011, 18:31I tried with this, but doesn't work:SELECT * FROM members ORDER BY date ASCSometimes it works with DESC.And also with this, and same!SELECT * STR_TO_DATE( date, '%D, %M %d, %Y, %H:%M' ) AS date_for_sort FROM `members` ORDER BY date_for_sort;I have this problem and I need to fix it asap for the business.
View 2 Replies
View Related
Jun 26, 2011
I want to insert a acess log file to mysql table.
my log file look like this;
08/Apr/2011 10:51:19 http://v4.netlogstatic.com/v6.00/385...t.messenger.js
08/Apr/2011 10:51:19 http://download.windowsupdate.com/ms...536945da07.exe
08/Apr/2011 10:51:19 http://www.google.lk/search?
08/Apr/2011 10:51:19 http://clients1.google.lk/generate_204
[Code].....
i want to insert this in to a table which having datetime (as it is in log file) and the site visited.
I created a mysql table using DATE using the date type and the TIME suing time type.but once i loaded this log to table date field shows empty. like following.
| 0000-00-00 | 04:18:29 | http://www.espncricinfo.com/navigati...scorecard.css?
how can I solve this problem.your responses are highly. My table should look like the following
| 08/Apr/2011 | 10:51:19 | http://www.radioeksen.com/song.txt
View 1 Replies
View Related
Mar 22, 2010
I wanna try to install ubuntu server on my poweredge 1955 with emc storage, but on the partitioning step it says:
"the following partitions will be formatted:
...<here goes all the lvms in the storage>..."
I already tried all the options in the partitioning step without success
View 3 Replies
View Related
Jun 17, 2010
I have installed Mysql in Ubuntu 9, for the use of roundcube database.After installing iam getting the error like this
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
So because of this in the roundcube configuration its giving the error message that MYSQL is not installed. So Kindly give me a idea how to solve this.
View 1 Replies
View Related
Jan 14, 2011
i was trying to allow remote access to mysql by following mysql was running perfectly until i got here :
Code:
/sbin/iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp --destination-port 3306 -j ACCEPT
i changed my.cnf bind-address line to : "bind-address = 127.0.0.1" and nothing
[code]....
View 4 Replies
View Related
Jul 27, 2011
I have two different table in a database in mysql that has no share key with each other and I want to sort them with each other on their date time column I mean when I sort it row X of table A that is older that row Y of table B comes earlier.
View 3 Replies
View Related
Feb 22, 2011
So I've got a rather vast database, one of the columns is date in the following format: DD/MM/YY HH:MM:SS. This is starting to cause problems with a php page I'm writing which asks the user for a 'start date'. Would it be better for me to split the date column into date and say time? Or is there a way of using distinct and masking the times.
View 10 Replies
View Related
Feb 6, 2010
I've successfully installed my LAMP server (9.10). I've ran a test.php but am curious if there are any tutorials onlines or even books to buy in order o learn how it all works. Where the files are and the mechanics of it. I have it installed but what now ha... I've done HTML, I've built websites but I'm lost!...
View 1 Replies
View Related
Jul 15, 2010
I need to uninstall Lamp from my Ubuntu 10.04 OS. I just need to commands etc as I am rather noob at Ubuntu. I will be installing it again I just have come across several problems.
View 2 Replies
View Related
Dec 22, 2010
I've looked at several tutorials and since i'm a newb I can't figure them out. I'm trying to set my hostname on my LAMP 10.04. What files do I need to configure? (all IP's below are fake)
Here are the first lines from /etc/apache2/sites-available/default
Code:
<VirtualHost 111.111.111.111:80>
ServerAdmin webmaster@localhost
/etc/apache2/ports.conf has these lines after the comments
[Code]....
View 4 Replies
View Related
May 24, 2011
I'm using ubuntu server 11.04 in a LAMP configuration. I have my login page setup but my php email verification isnt working. I would like to know how can I install a relay that can take the email verifications and send them through a gmail account.
View 2 Replies
View Related
May 25, 2010
When i load the local .csv file into mysql server the date format varies.Its mis matching.How to solve and match this.
View 1 Replies
View Related
Jan 13, 2010
I have a LAMP server running Ubuntu 8.04.03 Server edition running smoothly. Ive setup several websites on the server and all are ok, but I constantly have trouble with permissions. Everytime I setup a new domain to host, I setup a user specific to that domain. This allows SSH login specific to the domain. The problem I have is that every time I setup ownership in the virtual directories for the users they belong to, the settings don't seem to stay. Initially it seems to work ok, but when I install Joomla and setup the webspace, I always seem to have to login to the server itself to chmod the folders I need to have writable. I cant chmod properly from my FTP client which is weird. How to manage permissions?
Currently I am doing the following:
Code:
sudo mkdir -p {name of domain}/{public,private, etc...}
sudo usermod -g www-data {my user name}
sudo chown -R www-data:www-data /var/www/{directory for the domain}
sudo chmod -R 775 {folder path I need to change}
This works for a while but as I add new things to Joomla and I want to modify the folders, I always have to go back and redo the chmod and the chown commands to get them where I want.
View 4 Replies
View Related