Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default Load data infile - 01-26-2012, 04:15 PM

Hello !

Help me, please !! It's driving me mad !

I've got that code here :

Code:
<?php
require ('database_site.php');
 
 
$monde ='ALPHA'; //database name
$nom_url_fichiers = array(  
					array(  'Index' => "fichier1", 
							'Nom_Table' => "alpha_alliances",
							'Url_Fichier' => "/home/a6536850/public_html/fr/stats/cron/alliances.txt" 
					),
					array(  'Index' => "fichier2", 
							'Nom_Table' => "alpha_towns",
							'Url_Fichier' => "fr/stats/mondes/$monde/data/towns.txt" 
					),   
					array(  'Index' => "fichier3", 
							'Nom_Table' => "alpha_players",
							'Url_Fichier' => "../mondes/$monde/data/players.txt" 
					),
					array(  'Index' => "fichier4", 
							'Nom_Table' => "alpha_conquers",
							'Url_Fichier' => "../mondes/$monde/data/conquers.txt"
					),   
					array(  'Index' => "fichier5", 
							'Nom_Table' => "alpha_player_kills_att",
							'Url_Fichier' => "../mondes/$monde/data/player_kills_att.txt" 
					),   
					array(  'Index' => "fichier6", 
							'Nom_Table' => "alpha_player_kills_def",
							'Url_Fichier' => "../mondes/$monde/data/player_kills_def.txt" 
					),
					array(  'Index' => "fichier7", 
							'Nom_Table' => "alpha_player_kills_all",
							'Url_Fichier' => "../mondes/$monde/data/player_kills_all.txt"
					),   
					array(  'Index' => "fichier8", 
							'Nom_Table' => "alpha_alliance_kills_att",
							'Url_Fichier' => "../mondes/$monde/data/alliance_kills_att.txt" 
					),   
					array(  'Index' => "fichier9", 
							'Nom_Table' => "alpha_alliance_kills_def",
							'Url_Fichier' => "../mondes/$monde/data/alliance_kills_def.txt" 
					),
					array(  'Index' => "fichier10", 
							'Nom_Table' => "alpha_alliance_kills_all",
							'Url_Fichier' => "../mondes/$monde/data/alliance_kills_all.txt"
					),   
					);
 
 
foreach( $nom_url_fichiers as $fichiers ) {	
		$urlfichier = $fichiers['Url_Fichier'] or die('non mis à jour1'.mysql_error());
		$nomtable = $fichiers['Nom_Table'] or die('non mis à jour2'.mysql_error());
		mysql_query("TRUNCATE TABLE $nomtable") or die('non mis à jour3'.mysql_error());
		$sql = "LOAD DATA INFILE '$urlfichier' INTO TABLE $nomtable FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\\\\' LINES TERMINATED BY '\\n'" or die('non mis à jour4'.mysql_error());
        mysql_query($sql) or die('Problème avec LOAD DATA INFILE</br></br>'.mysql_error());
		}
 
		echo ' Rendez-vous dans 1 h pour la prochaine MAJ !';
		
		?>
And it returns me :

Quote:
Problème avec LOAD DATA INFILE

Access denied for user 'a6536850_gt'@'10.1.1.17' (using password: YES)


The files exists, I tried the full path links ... nothing

Host, username, password is fine ! not localhost ... and the support told me that it was allowed ...

PLEASE HELP !!!!
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
ShocK's Avatar
Senior Member
ShocK is on a distinguished road
 
Posts: 1,622
Join Date: Jul 2011
Location: UK
Default 01-26-2012, 05:02 PM

What are you using instead of localhost? Should look something like this - mysqlXX.000webhost.com
Reply With Quote
(#3 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 01-26-2012, 05:05 PM

I'm not ^^ That's why I don't understand ..

Code:
<?php
$host ='mysql4.000webhost.com'; //database location
$user ='a6536850_gt'; //database username
$pass ='XXXX'; //database password
$db ='a6536850_general'; //database name

$link_stats=mysql_connect($host, $user, $pass) or die ('Erreur : '.mysql_error());
mysql_select_db($db) or die ('Erreur : '.mysql_error());
?>
Reply With Quote
(#4 (permalink))
Old
tas tas is offline
Junior Member
tas is on a distinguished road
 
Posts: 20
Join Date: Jan 2012
Default 01-26-2012, 05:08 PM

Are you sure you specify Host correctly?

If you are then maybe check this instead,

http://dev.mysql.com/doc/refman/5.1/...ss-denied.html
Reply With Quote
(#5 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 01-26-2012, 05:10 PM

What is strange is when I change to Insert Into it works ...
Reply With Quote
(#6 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 01-26-2012, 05:37 PM

Ok ... I need a "LOCAL" because otherwise, it takes the file in the mysql file ....

Quote:
non mis à jourFile 'c:\wamp\bin\mysql\mysql5.5.16\mondes\ALPHA\data\t owns.txt' not found (Errcode: 2)
In my localhost ...


But "local" is desactivated ... help !!
Reply With Quote
(#7 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 01-26-2012, 07:00 PM

Quote:
"".$_SERVER['DOCUMENT_ROOT']."/stats/mondes/$monde/data/alliances.txt"
I know why ! I tried on my local host and I had to do that to have the file !!

But how to do it in 000webhost ...
Reply With Quote
(#8 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 01-28-2012, 06:47 PM

Please !!!

An idea ??
Reply With Quote
(#9 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 01-31-2012, 06:54 PM

Pleaseee I'm completly bloqued
Reply With Quote
(#10 (permalink))
Old
Junior Member
JBGO is on a distinguished road
 
Posts: 13
Join Date: Aug 2011
Default 02-04-2012, 05:16 PM

Is somebody going to find a solution ?? I'm getting a bit fed up of waiting 12 h to have at the end a copy/past reply of what I just said before !!

Can I have a solution OR have I just got to leave to another HOST ? It's NOT too difficult for you ... EVEN small hosts like olympe-network and azok offers that function !

Problème of GRANT ? If I've got to use a INSERT INTO, I will do it but your hosts are going to suffer !

I don't like to shout like that but my site is bloqued and It's getting on my nerves .. when the rest is ready !

Please ! Answer !

Last edited by JBGO; 02-04-2012 at 05:29 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com